From 10570d508f79917571b1deaa2d1f66dca7385835 Mon Sep 17 00:00:00 2001 From: Eeshan Garg Date: Mon, 23 Jul 2018 16:32:07 -0230 Subject: [PATCH] tools/lint: Fix JSON lint pattern for spaces after ':'. Previously, a string ending in "... :smile:" was reported as an error and the linter complained that there should be a space after the last ':'. This commit changes the pattern so that the linter only checks for colons that are preceded by an opening double-quote ("). --- tools/linter_lib/custom_check.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/linter_lib/custom_check.py b/tools/linter_lib/custom_check.py index 4c4ee5a113..9c427271da 100644 --- a/tools/linter_lib/custom_check.py +++ b/tools/linter_lib/custom_check.py @@ -802,7 +802,7 @@ def build_custom_checkers(by_lang): 'strip': '\n', 'exclude': set(['zerver/webhooks/']), 'description': 'Fix tab-based whitespace'}, - {'pattern': r':["\[\{]', + {'pattern': r'":["\[\{]', 'exclude': set(['zerver/webhooks/', 'zerver/tests/fixtures/']), 'description': 'Require space after : in JSON'}, ] # type: RuleList