diff options
author | Anthony Barbier <anthony.barbier@arm.com> | 2017-07-03 17:39:37 +0100 |
---|---|---|
committer | Anthony Barbier <anthony.barbier@arm.com> | 2018-09-17 14:15:39 +0100 |
commit | ac69aa137e360340fe9f148f019d93af6c3d8336 (patch) | |
tree | 88c2fb6ea8693c69b19d3b7b38fe26cd916303c8 /scripts/check_bad_style.sh | |
parent | 05da6dd102c988081c7d5eccb227f559f740ceef (diff) | |
download | ComputeLibrary-ac69aa137e360340fe9f148f019d93af6c3d8336.tar.gz |
COMPMID-418 Add check and fix comments after preprocessor conditions
Change-Id: I1353fd652ee180e3931e58b4ce13d651a48c7e2c
Reviewed-on: http://mpd-gerrit.cambridge.arm.com/79567
Tested-by: Kaizen <jeremy.johnson+kaizengerrit@arm.com>
Reviewed-by: Moritz Pflanzer <moritz.pflanzer@arm.com>
Diffstat (limited to 'scripts/check_bad_style.sh')
-rwxr-xr-x | scripts/check_bad_style.sh | 17 |
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 |