mirror of https://github.com/zulip/zulip.git
lint: Exclude "subject" from JS files (except util.js).
We also exempt the frontend tests for now.
This commit is contained in:
parent
1ad30c6858
commit
4d5ce0b285
|
@ -261,6 +261,13 @@ def build_custom_checkers(by_lang):
|
||||||
'bad_lines': ['###some heading', '#another heading']},
|
'bad_lines': ['###some heading', '#another heading']},
|
||||||
] # type: RuleList
|
] # type: RuleList
|
||||||
js_rules = cast(RuleList, [
|
js_rules = cast(RuleList, [
|
||||||
|
{'pattern': 'subject|SUBJECT',
|
||||||
|
'exclude': set(['static/js/util.js',
|
||||||
|
'frontend_tests/']),
|
||||||
|
'exclude_pattern': 'emails',
|
||||||
|
'description': 'avoid subject in JS code',
|
||||||
|
'good_lines': ['topic_name'],
|
||||||
|
'bad_lines': ['subject="foo"', ' MAX_SUBJECT_LEN']},
|
||||||
{'pattern': r'[^_]function\(',
|
{'pattern': r'[^_]function\(',
|
||||||
'description': 'The keyword "function" should be followed by a space'},
|
'description': 'The keyword "function" should be followed by a space'},
|
||||||
{'pattern': r'.*blueslip.warning\(.*',
|
{'pattern': r'.*blueslip.warning\(.*',
|
||||||
|
|
Loading…
Reference in New Issue