From ac69aa137e360340fe9f148f019d93af6c3d8336 Mon Sep 17 00:00:00 2001 From: Anthony Barbier Date: Mon, 3 Jul 2017 17:39:37 +0100 Subject: 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 Reviewed-by: Moritz Pflanzer --- scripts/check_bad_style.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'scripts') 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 -- cgit v1.2.1