aboutsummaryrefslogtreecommitdiff
path: root/scripts/check_bad_style.sh
diff options
context:
space:
mode:
authorAnthony Barbier <anthony.barbier@arm.com>2017-09-04 18:44:23 +0100
committerAnthony Barbier <anthony.barbier@arm.com>2018-09-17 13:03:09 +0100
commit6ff3b19ee6120edf015fad8caab2991faa3070af (patch)
treea7a6dcd16dfd56d79fa1b56a313caeebcc939b68 /scripts/check_bad_style.sh
downloadComputeLibrary-6ff3b19ee6120edf015fad8caab2991faa3070af.tar.gz
COMPMID-344 Updated doxygen
Change-Id: I32f7b84daa560e460b77216add529c8fa8b327ae
Diffstat (limited to 'scripts/check_bad_style.sh')
-rwxr-xr-xscripts/check_bad_style.sh71
1 files changed, 71 insertions, 0 deletions
diff --git a/scripts/check_bad_style.sh b/scripts/check_bad_style.sh
new file mode 100755
index 0000000000..1cc514cdc3
--- /dev/null
+++ b/scripts/check_bad_style.sh
@@ -0,0 +1,71 @@
+#!/bin/bash
+
+set -e
+
+DIRECTORIES="./arm_compute ./src ./examples ./tests ./utils"
+
+grep -HrnP "/\*\*$" $DIRECTORIES | tee bad_style.log
+if (( `cat bad_style.log | wc -l` > 0 ))
+then
+ echo ""
+ echo "ERROR: Doxygen comments should start on the first line: \"/** My comment\""
+ exit -1
+fi
+
+grep -Hnr --exclude=Doxyfile "@brief" $DIRECTORIES | tee bad_style.log
+if (( `cat bad_style.log | wc -l` > 0 ))
+then
+ echo ""
+ echo "ERROR: Doxygen comments shouldn't use '@brief'"
+ exit -1
+fi
+
+grep -HnRE "\buint " --exclude-dir=cl_kernels $DIRECTORIES | tee bad_style.log
+if [[ $(cat bad_style.log | wc -l) > 0 ]]
+then
+ echo ""
+ echo "ERROR: C/C++ don't define 'uint'. Use 'unsigned int' instead."
+ exit -1
+fi
+
+grep -HnR "float32_t" $DIRECTORIES | tee bad_style.log
+if [[ $(cat bad_style.log | wc -l) > 0 ]]
+then
+ echo ""
+ echo "ERROR: C/C++ don't define 'float32_t'. Use 'float' instead."
+ exit -1
+fi
+
+grep -Hnir "arm[_ ]\?cv" $DIRECTORIES | tee bad_style.log
+if [[ $(cat bad_style.log | wc -l) > 0 ]]
+then
+ echo ""
+ echo "ERROR: Reference to arm_cv detected in the files above (Replace with arm_compute)"
+ exit -1
+fi
+
+spdx_missing=0
+for f in $(find $DIRECTORIES -type f)
+do
+ if [[ $(grep SPDX $f | wc -l) == 0 ]]
+ then
+ # List of exceptions:
+ case `basename $f` in
+ "arm_compute_version.embed");;
+ ".clang-format");;
+ ".clang-tidy");;
+ #It's an error for other files to not contain the MIT header:
+ *)
+ spdx_missing=1
+ echo $f;
+ ;;
+ esac
+ fi;
+done
+
+if [[ $spdx_missing > 0 ]]
+then
+ echo ""
+ echo "ERROR: MIT Copyright header missing from the file(s) above."
+ exit -1
+fi