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:
Tim Abbott
2017-10-18 10:16:41 -07:00
parent 8afe9835f6
commit 2bc14d256f
8 changed files with 20 additions and 20 deletions

View File

@@ -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]);

View File

@@ -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',