summaryrefslogtreecommitdiff
path: root/conf/uncrustify.sh
diff options
context:
space:
mode:
authorng0 <ng0@n0.is>2019-10-09 17:30:49 +0000
committerng0 <ng0@n0.is>2019-10-09 17:30:49 +0000
commit55bd2280c8a69261f01cd06ae88e3e7ae32cf58b (patch)
tree139a13b17edc0268ba7018875a30ef98bbcd9159 /conf/uncrustify.sh
parentf3fcc325beac420111498f428764ccad8109f599 (diff)
downloadbuild-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-xconf/uncrustify.sh14
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