mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 14:03:30 +00:00
lint: Ban two spaces after comma in JS code.
We exclude the frontend tests, mostly because the lint rule isn't that precise, and the test code has some sample user input that's a bit funny.
This commit is contained in:
@@ -396,7 +396,7 @@ function populate_messages_sent_by_client(data) {
|
||||
plot_data.values.reverse();
|
||||
plot_data.labels.reverse();
|
||||
plot_data.percentages.reverse();
|
||||
var annotations = { values : [], labels : [], text : []};
|
||||
var annotations = {values: [], labels: [], text: []};
|
||||
for (var i=0; i<plot_data.values.length; i+=1) {
|
||||
if (plot_data.values[i] > 0) {
|
||||
annotations.values.push(plot_data.values[i]);
|
||||
|
||||
@@ -146,8 +146,8 @@ def build_custom_checkers(by_lang):
|
||||
'description': 'Fix tab-based whitespace'},
|
||||
] # type: RuleList
|
||||
comma_whitespace_rule = [
|
||||
{'pattern': ', {2,}[^# ]',
|
||||
'exclude': set(['zerver/tests']),
|
||||
{'pattern': ', {2,}[^#/ ]',
|
||||
'exclude': set(['zerver/tests', 'frontend_tests/node_tests']),
|
||||
'description': "Remove multiple whitespaces after ','",
|
||||
'good_lines': ['foo(1, 2, 3)', 'foo = bar # some inline comment'],
|
||||
'bad_lines': ['foo(1, 2, 3)', 'foo(1, 2, 3)']},
|
||||
@@ -232,7 +232,7 @@ def build_custom_checkers(by_lang):
|
||||
]),
|
||||
'good_lines': ['#my-style {color: blue;}'],
|
||||
'bad_lines': ['<p style="color: blue;">Foo</p>', 'style = "color: blue;"']},
|
||||
]) + whitespace_rules
|
||||
]) + whitespace_rules + comma_whitespace_rule
|
||||
python_rules = cast(RuleList, [
|
||||
{'pattern': '^(?!#)@login_required',
|
||||
'description': '@login_required is unsupported; use @zulip_login_required',
|
||||
|
||||
Reference in New Issue
Block a user