aboutsummaryrefslogtreecommitdiff
path: root/scripts/check_bad_style.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/check_bad_style.sh')
-rwxr-xr-xscripts/check_bad_style.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/scripts/check_bad_style.sh b/scripts/check_bad_style.sh
index 1cc514cdc3..29d14bdb4a 100755
--- a/scripts/check_bad_style.sh
+++ b/scripts/check_bad_style.sh
@@ -44,6 +44,23 @@ then
exit -1
fi
+grep -Hnir "#.*defined[^(]" $DIRECTORIES | tee bad_style.log
+if [[ $(cat bad_style.log | wc -l) > 0 ]]
+then
+ echo ""
+ echo "ERROR: use parenthesis after #if defined(MY_PREPROCESSOR)"
+ exit -1
+fi
+
+grep -Hnir "#else$\|#endif$" $DIRECTORIES | tee bad_style.log
+if [[ $(cat bad_style.log | wc -l) > 0 ]]
+then
+ echo ""
+ echo "ERROR: #else and #endif should be followed by a comment of the guard they refer to (e.g /* ARM_COMPUTE_ENABLE_FP16 */ )"
+ exit -1
+fi
+
+
spdx_missing=0
for f in $(find $DIRECTORIES -type f)
do