Add autoformat.sh script

This commit is contained in:
Roman Grundkiewicz 2017-06-05 12:45:13 +02:00
parent f734c82b04
commit 8c9743121b
2 changed files with 9 additions and 2 deletions

View File

@ -11,7 +11,11 @@ Main code style rules:
* no space between control statements and opening brackets
Alternatively, use the provided `.clang-format` file for
[ClangFormat](https://clang.llvm.org/docs/ClangFormat.html) to format new code fragments, e.g.
[ClangFormat](https://clang.llvm.org/docs/ClangFormat.html) to format new code
fragments, e.g.
clang-format-3.8 -style=./contrib/.clang-format <source-or-header-file>
clang-format-3.8 <path_to_file>
*Notice*: If you want to merge your changes from the repository cloned before
autoformatting on all files in the _master_ repository, you may want to use the
`autoformat.sh` script on your files before the merge.

3
contrib/autoformat.sh Executable file
View File

@ -0,0 +1,3 @@
#!/bin/bash
find ./src -path ./src/3rd_party -prune -o -iname *.h -o -iname *.cpp | xargs clang-format-3.8 -i