diff options
author | Christian Grothoff <christian@grothoff.org> | 2019-10-05 15:49:28 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2019-10-05 15:49:28 +0200 |
commit | 54bde12c0295e008e050a8418c4702b8f3ea4a55 (patch) | |
tree | 3d5e4a60f4fe749e3348e228617c2105224b9b15 /contrib/uncrustify.sh | |
parent | 99a8156209ae62a8b5d73fcf9fef25c03b89a6ca (diff) |
add uncrustify hook
Diffstat (limited to 'contrib/uncrustify.sh')
-rwxr-xr-x | contrib/uncrustify.sh | 14 |
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 |