mirror of
https://github.com/zulip/zulip.git
synced 2025-11-14 10:57:58 +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:
|
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.
|
||||||
|
|
||||||
|
|||||||
@@ -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': "% [(]",
|
||||||
|
|||||||
Reference in New Issue
Block a user