mirror of
https://github.com/zulip/zulip.git
synced 2025-11-13 18:36:36 +00:00
linter: Extend no-space-before-bracket linting rule.
This commit is contained in:
@@ -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.
|
||||
|
||||
|
||||
@@ -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': "% [(]",
|
||||
|
||||
Reference in New Issue
Block a user