Adds a test to check_style.sh to check for spaces before colon (:) in range based for loops.

This commit is contained in:
Christian Parpart
2019-06-24 17:32:58 +02:00
committed by chriseth
parent 3b0284817e
commit 7b3aba81fb
3 changed files with 3 additions and 7 deletions
+1
View File
@@ -18,6 +18,7 @@ fi
FORMATERROR=$(
(
git grep -nIE "\<(if|for)\(" -- '*.h' '*.cpp' # no space after "if" or "for"
git grep -nIE "\<for\>\s*\([^=]*\>\s:\s.*\)" -- '*.h' '*.cpp' # no space before range based for-loop
git grep -nIE "\<if\>\s*\(.*\)\s*\{\s*$" -- '*.h' '*.cpp' # "{\n" on same line as "if" / "for"
git grep -nIE "[,\(<]\s*const " -- '*.h' '*.cpp' # const on left side of type
git grep -nIE "^\s*(static)?\s*const " -- '*.h' '*.cpp' # const on left side of type (beginning of line)