summaryrefslogtreecommitdiff
path: root/contrib/uncrustify.sh
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2019-08-25 22:59:39 +0200
committerChristian Grothoff <christian@grothoff.org>2019-08-25 22:59:39 +0200
commitb91e6f719e865d8f81610b4c69849e43b03a35d8 (patch)
tree7ff54f4128e4bbf6993644de585ff51db4c3c1e1 /contrib/uncrustify.sh
parent5d7265871c653ebe72d59bb153ca07590b2ca5a7 (diff)
suggested uncrustify config
Diffstat (limited to 'contrib/uncrustify.sh')
-rwxr-xr-xcontrib/uncrustify.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/contrib/uncrustify.sh b/contrib/uncrustify.sh
new file mode 100755
index 00000000..e8e05d3e
--- /dev/null
+++ b/contrib/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