aboutsummaryrefslogtreecommitdiff
path: root/scripts/reformat_cpp.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/reformat_cpp.sh')
-rwxr-xr-xscripts/reformat_cpp.sh22
1 files changed, 22 insertions, 0 deletions
diff --git a/scripts/reformat_cpp.sh b/scripts/reformat_cpp.sh
new file mode 100755
index 00000000..51127529
--- /dev/null
+++ b/scripts/reformat_cpp.sh
@@ -0,0 +1,22 @@
+#!/bin/sh
+set -eu
+
+SCRIPT_DIR=$(dirname "$0")
+case $SCRIPT_DIR in
+ "/"*)
+ ;;
+ ".")
+ SCRIPT_DIR=$(pwd)
+ ;;
+ *)
+ SCRIPT_DIR=$(pwd)/$(dirname "$0")
+ ;;
+esac
+
+TOPDIR="$SCRIPT_DIR/.."
+
+for i in "$TOPDIR"/include/proj/*.hpp "$TOPDIR"/include/proj/internal/*.hpp "$TOPDIR"/src/*.cpp "$TOPDIR"/test/unit/test*.cpp; do
+ if ! echo "$i" | grep -q "lru_cache.hpp"; then
+ "$SCRIPT_DIR"/reformat.sh "$i";
+ fi
+done