2020-03-23 08:46:02 +08:00
|
|
|
#!/bin/bash
|
2016-08-20 06:36:49 +08:00
|
|
|
|
2018-02-21 22:15:57 +08:00
|
|
|
set -ex
|
2016-08-20 02:31:08 +08:00
|
|
|
|
2018-02-21 22:15:57 +08:00
|
|
|
FIND="find ."
|
2018-08-26 17:42:08 +08:00
|
|
|
FIND="$FIND '(' -name '*.[ch]' ')'"
|
2018-02-21 22:15:57 +08:00
|
|
|
FIND="$FIND -and -not -name '*.api.h'"
|
|
|
|
FIND="$FIND -and -not -wholename './super_donators/*'"
|
|
|
|
FIND="$FIND -and -not -wholename './third_party/*'"
|
|
|
|
FIND="$FIND -and -not -wholename './toxencryptsave/crypto_pwhash*'"
|
|
|
|
|
2020-05-03 22:36:57 +08:00
|
|
|
readarray -t C_SOURCES <<<"$(eval "$FIND")"
|
2024-02-02 08:09:27 +08:00
|
|
|
readarray -t CC_SOURCES <<<"$(find . '(' -name '*.cc' -or -name '*.hh' ')')"
|
|
|
|
#CC_SOURCES+=(toxcore/crypto_core.c)
|
|
|
|
#CC_SOURCES+=(toxcore/ping_array.c)
|
|
|
|
|
|
|
|
# Format C++ sources with clang-format.
|
|
|
|
clang-format -i "${CC_SOURCES[@]}"
|
2016-08-20 06:36:49 +08:00
|
|
|
|
2024-02-02 08:09:27 +08:00
|
|
|
# Format C sources with astyle. We can't use clang-format, because it strongly
|
|
|
|
# messes up formatting of non_null annotations.
|
|
|
|
astyle -n --options=other/astyle/astylerc "${C_SOURCES[@]}"
|
2016-08-20 02:31:08 +08:00
|
|
|
|
2020-05-03 22:36:57 +08:00
|
|
|
git diff --color=always --exit-code
|