More style checks.

This commit is contained in:
Daniel Kirchner
2019-02-14 11:41:20 +01:00
parent f003696d7e
commit 8ca6715e18
11 changed files with 16 additions and 13 deletions
+4 -1
View File
@@ -19,8 +19,11 @@ FORMATERROR=$(
(
git grep -nIE "\<(if|for)\(" -- '*.h' '*.cpp' # no space after "if" or "for"
git grep -nIE "\<if\>\s*\(.*\)\s*\{\s*$" -- '*.h' '*.cpp' # "{\n" on same line as "if" / "for"
git grep -nIE "\(const " -- '*.h' '*.cpp' # const on left side of type
git grep -nIE "[,\(<]\s*const " -- '*.h' '*.cpp' # const on left side of type
git grep -nIE "^ [^*]|[^*] | [^*]" -- '*.h' '*.cpp' # uses spaces for indentation or mixes spaces and tabs
git grep -nIE "[a-zA-Z0-9_]\s*[&][a-zA-Z_]" -- '*.h' '*.cpp' | egrep -v "return [&]" # right-aligned reference ampersand (needs to exclude return)
# right-aligned reference pointer star (needs to exclude return and comments)
git grep -nIE "[a-zA-Z0-9_]\s*[*][a-zA-Z_]" -- '*.h' '*.cpp' | egrep -v "return [*]" | egrep -v "^* [*]" | egrep -v "^*//.*"
) | egrep -v "^[a-zA-Z\./]*:[0-9]*:\s*\/(\/|\*)" | egrep -v "^test/"
)