Fix coding style with uncrustify #4891

pull kostaz wants to merge 1 commits into bitcoin:master from kostaz:uncrustify changing 135 files +20836 −7181
  1. kostaz commented at 4:19 PM on September 10, 2014: contributor

    The purpose of this patch is to propose and discuss the coding style for the Bitcoin Core source code.

    The main idea of this approach is:

    • Love spaces
    • Love newlines '\n'
    • Love empty lines to delimit the code parts
    • Put curly braces everywhere and always on the new line

    I believe that this approach produce the code that is especially easy to read and understand for the non-pro person diving into the world of Bitcoin.

    The 'uncrustify' 0.59 tool was used to fix the coding style (from official Ubuntu 14.04 repo).

    The command used to process the files:

    find . -iname "*.h" -o -iname "*.cc" -o -iname "*.cpp" | sort | grep -v "src\/leveldb\/" | grep -v "src\/json\/" | grep -v "src\/qt\/" | grep -v "src\/test\/" | xargs -I '{}' uncrustify -c .uncrustify.cfg --no-backup --replace '{}'
    
    • UniversalIndentGUI program may be used to try and test the coding style easily
    • 'uncrustify' does not support partial files (as git clang-format does, at least I'm not aware of one)
  2. Fix coding style with uncrustify
    The purpose of this patch is to propose and discuss the coding style
    for the Bitcoin Core source code.
    
    The main idea of this approach is:
     - Love spaces
     - Love newlines '\n'
     - Love empty lines to delimit the code parts
     - Put curly braces **everywhere** and always on the new line
    
    I believe that this approach produce the code that is especially
    easy to read and understand for the non-pro person diving into
    the world of Bitcoin.
    
    The 'uncrustify' 0.59 tool was used to fix the coding style (from official
    Ubuntu 14.04 repo).
    
    The command used to process the files:
    ```
    find . -iname "*.h" -o -iname "*.cc" -o -iname "*.cpp" | sort | grep -v "src\/leveldb\/" | grep -v "src\/json\/" | grep -v "src\/qt\/" | grep -v "src\/test\/" | xargs -I '{}' uncrustify -c .uncrustify.cfg --no-backup --replace '{}'
    ```
    
     - UniversalIndentGUI program may be used to try and test the coding style easily
    
     - 'uncrustify' does not support partial files
       (as `git clang-format` does, at least I'm not aware of one)
    4955de592c
  3. BitcoinPullTester commented at 4:20 PM on September 10, 2014: none

    Automatic sanity-testing: FAILED MERGE, see http://jenkins.bluematt.me/pull-tester/p4891_4955de592c10faebeed97ec25bfe5b3b76b4663b/ for test log.

    This pull does not merge cleanly onto current master This test script verifies pulls every time they are updated. It, however, dies sometimes and fails to test properly. If you are waiting on a test, please check timestamps to verify that the test.log is moving at http://jenkins.bluematt.me/pull-tester/current/ Contact BlueMatt on freenode if something looks broken.

  4. laanwj commented at 5:23 PM on September 10, 2014: member

    Didn't you see my comment on #4847? @sipa is already working on this using clang-format. There is even a src/.clang-format configuration file checked in already.

  5. jtimon commented at 4:26 PM on September 14, 2014: contributor

    Commented on #4498

  6. sipa commented at 2:15 AM on September 16, 2014: member

    Going to close this. I'm willing to keep the discussion about the actual style open, but we're certainly not going to convert every source file in the repo.

  7. sipa closed this on Sep 16, 2014

  8. kostaz commented at 3:01 PM on September 16, 2014: contributor

    Ok.

  9. MarcoFalke locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-17 06:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me