diff options
Diffstat (limited to 'other/astyle/format-source')
-rwxr-xr-x | other/astyle/format-source | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/other/astyle/format-source b/other/astyle/format-source index 5e139d89..550bcf07 100755 --- a/other/astyle/format-source +++ b/other/astyle/format-source | |||
@@ -49,15 +49,25 @@ if grep '<unresolved>' */*.h; then | |||
49 | exit 1 | 49 | exit 1 |
50 | fi | 50 | fi |
51 | 51 | ||
52 | CC_SOURCES=`find . '(' -name '*.cc' ')'` | ||
53 | CC_SOURCES="$CC_SOURCES toxcore/ping_array.c" | ||
54 | |||
55 | for bin in clang-format-6.0 clang-format-5.0 clang-format; do | ||
56 | if which "$bin"; then | ||
57 | "$bin" -i -style='{BasedOnStyle: Google, ColumnLimit: 100}' $CC_SOURCES | ||
58 | break | ||
59 | fi | ||
60 | done | ||
61 | |||
52 | FIND="find ." | 62 | FIND="find ." |
53 | FIND="$FIND '(' -name '*.[ch]' -or -name '*.cpp' ')'" | 63 | FIND="$FIND '(' -name '*.[ch]' ')'" |
54 | FIND="$FIND -and -not -name '*.api.h'" | 64 | FIND="$FIND -and -not -name '*.api.h'" |
55 | FIND="$FIND -and -not -wholename './super_donators/*'" | 65 | FIND="$FIND -and -not -wholename './super_donators/*'" |
56 | FIND="$FIND -and -not -wholename './third_party/*'" | 66 | FIND="$FIND -and -not -wholename './third_party/*'" |
57 | FIND="$FIND -and -not -wholename './toxencryptsave/crypto_pwhash*'" | 67 | FIND="$FIND -and -not -wholename './toxencryptsave/crypto_pwhash*'" |
58 | 68 | ||
59 | SOURCES=`eval "$FIND"` | 69 | C_SOURCES=`eval "$FIND"` |
60 | 70 | ||
61 | $ASTYLE -n --options=other/astyle/astylerc $SOURCES | 71 | $ASTYLE -n --options=other/astyle/astylerc $C_SOURCES |
62 | 72 | ||
63 | git diff --exit-code | 73 | git diff --exit-code |