Mercurial > hg-stable
changeset 27640:8d0a09162d0f
check-code: enforce strict spacing around assignment
author | timeless <timeless@mozdev.org> |
---|---|
date | Thu, 31 Dec 2015 17:41:59 +0000 |
parents | dbd47b21fd28 |
children | f6457349985b |
files | contrib/check-code.py |
diffstat | 1 files changed, 3 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/contrib/check-code.py Thu Dec 31 08:17:28 2015 +0000 +++ b/contrib/check-code.py Thu Dec 31 17:41:59 2015 +0000 @@ -127,6 +127,7 @@ (r'seq ', "don't use 'seq', use $TESTDIR/seq.py"), (r'\butil\.Abort\b', "directly use error.Abort"), (r'\|&', "don't use |&, use 2>&1"), + (r'\w = +\w', "only one space after = allowed"), ], # warnings [ @@ -220,6 +221,7 @@ (r'(\w|\)),\w', "missing whitespace after ,"), (r'(\w|\))[+/*\-<>]\w', "missing whitespace in expression"), (r'^\s+(\w|\.)+=\w[^,()\n]*$', "missing whitespace in assignment"), + (r'\w\s=\s\s+\w', "gratuitous whitespace after ="), (r'.{81}', "line too long"), (r' x+[xo][\'"]\n\s+[\'"]x', 'string join across lines with no space'), (r'[^\n]\Z', "no trailing newline"), @@ -337,6 +339,7 @@ (r'\w+ (\+\+|--)', "use foo++, not foo ++"), (r'\w,\w', "missing whitespace after ,"), (r'^[^#]\w[+/*]\w', "missing whitespace in expression"), + (r'\w\s=\s\s+\w', "gratuitous whitespace after ="), (r'^#\s+\w', "use #foo, not # foo"), (r'[^\n]\Z', "no trailing newline"), (r'^\s*#import\b', "use only #include in standard C code"),