summaryrefslogtreecommitdiff
path: root/tools/cstyle.py
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2015-05-12 08:02:07 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2015-05-12 08:02:07 -0400
commit163131f4b8572c1b62956f060913b34397340174 (patch)
treeecf2b12b785f6bb454621d3256b8e35ca46237bf /tools/cstyle.py
parentdeeb5652e2603a3977b8436bbb753341ab9e011c (diff)
add check for white-space only lines; fix tests to allow for _(...) macro and function (); rather than function () ;
Diffstat (limited to 'tools/cstyle.py')
-rwxr-xr-xtools/cstyle.py17
1 files changed, 9 insertions, 8 deletions
diff --git a/tools/cstyle.py b/tools/cstyle.py
index 415c47795d..bad8309dae 100755
--- a/tools/cstyle.py
+++ b/tools/cstyle.py
@@ -116,26 +116,27 @@ class CStyleChecker:
[ ( re.compile ("^ "), "leading space as indentation instead of tab - use tabs to indent, spaces to align" )
, ( re.compile ("{[^\s]"), "missing space after open brace" )
, ( re.compile ("[^\s]}"), "missing space before close brace" )
- , ( re.compile ("[ \t]+$"), "contains trailing whitespace" )
-
+ , ( re.compile ("^[ \t]+$"), "empty line contains whitespace" )
+ , ( re.compile ("[^\s][ \t]+$"), "contains trailing whitespace" )
+
, ( re.compile (",[^\s\n]"), "missing space after comma" )
, ( re.compile (";[a-zA-Z0-9]"), "missing space after semi-colon" )
, ( re.compile ("=[^\s\"'=]"), "missing space after assignment" )
- # Open and close parenthesis.
- , ( re.compile ("[^\s\(\[\*&']\("), "missing space before open parenthesis" )
- , ( re.compile ("\)(-[^>]|[^,'\s\n\)\]-])"), "missing space after close parenthesis" )
+ # Open and close parenthesis.
+ , ( re.compile ("[^_\s\(\[\*&']\("), "missing space before open parenthesis" )
+ , ( re.compile ("\)(-[^>]|[^;,'\s\n\)\]-])"), "missing space after close parenthesis" )
, ( re.compile ("\( [^;]"), "space after open parenthesis" )
, ( re.compile ("[^;] \)"), "space before close parenthesis" )
-
+
# Open and close square brace.
, ( re.compile ("\[ "), "space after open square brace" )
, ( re.compile (" \]"), "space before close square brace" )
-
+
# Space around operators.
, ( re.compile ("[^\s][\*/%+-][=][^\s]"), "missing space around opassign" )
, ( re.compile ("[^\s][<>!=^/][=]{1,2}[^\s]"), "missing space around comparison" )
-
+
# Parens around single argument to return.
, ( re.compile ("\s+return\s+\([a-zA-Z0-9_]+\)\s+;"), "parens around return value" )
]