linter: Extend no-space-before-bracket linting rule.

This commit is contained in:
derAnfaenger
2017-10-05 15:09:46 +02:00
committed by Tim Abbott
parent c957d1857e
commit c01981a65f
2 changed files with 4 additions and 4 deletions

View File

@@ -242,8 +242,6 @@ code a lot uglier, in which case it's fine to go up to 120 or so.
Whitespace guidelines:
- Put one space between keywords like `if` and `while` and their
associated open paren.
- Put no space before or after the open paren for function calls and
no space before the close paren for function calls.

View File

@@ -249,8 +249,10 @@ def build_custom_checkers(by_lang):
'description': 'Missing : after type in type annotation'},
{'pattern': "#type",
'description': 'Missing whitespace after "#" in type annotation'},
{'pattern': 'if[(]',
'description': 'Missing space between if and ('},
{'pattern': r'\b(if|else|while)[(]',
'description': 'Put a space between statements like if, else, etc. and (.',
'good_lines': ['if (1 == 2):', 'while (foo == bar):'],
'bad_lines': ['if(1 == 2):', 'while(foo == bar):']},
{'pattern': ", [)]",
'description': 'Unnecessary whitespace between "," and ")"'},
{'pattern': "% [(]",