mirror of
https://github.com/zulip/zulip.git
synced 2025-11-08 07:52:19 +00:00
linter: Catch all malformatted string formatting clauses.
This also catches code like `"foo%s"%('bar')`, whereas before,
the first tuple entry could not be a string.
This commit is contained in:
@@ -191,9 +191,9 @@ def build_custom_checkers(by_lang):
|
|||||||
python_rules = cast(RuleList, [
|
python_rules = cast(RuleList, [
|
||||||
{'pattern': '^(?!#)@login_required',
|
{'pattern': '^(?!#)@login_required',
|
||||||
'description': '@login_required is unsupported; use @zulip_login_required'},
|
'description': '@login_required is unsupported; use @zulip_login_required'},
|
||||||
{'pattern': '".*"%\([a-z_].*\)?$',
|
{'pattern': '".*"%\(.*\)?$',
|
||||||
'description': 'Missing space around "%"'},
|
'description': 'Missing space around "%"'},
|
||||||
{'pattern': "'.*'%\([a-z_].*\)?$",
|
{'pattern': "'.*'%\(.*\)?$",
|
||||||
'exclude': set(['analytics/lib/counts.py',
|
'exclude': set(['analytics/lib/counts.py',
|
||||||
'analytics/tests/test_counts.py',
|
'analytics/tests/test_counts.py',
|
||||||
]),
|
]),
|
||||||
|
|||||||
Reference in New Issue
Block a user