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: 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 - Put no space before or after the open paren for function calls and
no space before the close paren for function calls. 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'}, 'description': 'Missing : after type in type annotation'},
{'pattern': "#type", {'pattern': "#type",
'description': 'Missing whitespace after "#" in type annotation'}, 'description': 'Missing whitespace after "#" in type annotation'},
{'pattern': 'if[(]', {'pattern': r'\b(if|else|while)[(]',
'description': 'Missing space between if and ('}, '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': ", [)]", {'pattern': ", [)]",
'description': 'Unnecessary whitespace between "," and ")"'}, 'description': 'Unnecessary whitespace between "," and ")"'},
{'pattern': "% [(]", {'pattern': "% [(]",