diff options
author | ng0 <ng0@n0.is> | 2019-10-09 17:30:49 +0000 |
---|---|---|
committer | ng0 <ng0@n0.is> | 2019-10-09 17:30:49 +0000 |
commit | 55bd2280c8a69261f01cd06ae88e3e7ae32cf58b (patch) | |
tree | 139a13b17edc0268ba7018875a30ef98bbcd9159 /conf/uncrustify.sh | |
parent | f3fcc325beac420111498f428764ccad8109f599 (diff) | |
download | build-common-55bd2280c8a69261f01cd06ae88e3e7ae32cf58b.tar.gz build-common-55bd2280c8a69261f01cd06ae88e3e7ae32cf58b.tar.bz2 build-common-55bd2280c8a69261f01cd06ae88e3e7ae32cf58b.zip |
check in code independent build system code.
Diffstat (limited to 'conf/uncrustify.sh')
-rwxr-xr-x | conf/uncrustify.sh | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/conf/uncrustify.sh b/conf/uncrustify.sh new file mode 100755 index 0000000..e8e05d3 --- /dev/null +++ b/conf/uncrustify.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +set -eu + +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" + +if ! uncrustify --version >/dev/null; then + echo "you need to install uncrustify for indentation" + exit 1 +fi + +find "$DIR/../src" \( -name "*.cpp" -o -name "*.c" -o -name "*.h" \) \ + -exec uncrustify -c "$DIR/uncrustify.cfg" --replace --no-backup {} + \ + || true |