From 4d5ce0b28539eb298197607faefebcc44184b4a6 Mon Sep 17 00:00:00 2001 From: Steve Howell Date: Sun, 23 Dec 2018 16:58:31 +0000 Subject: [PATCH] lint: Exclude "subject" from JS files (except util.js). We also exempt the frontend tests for now. --- tools/linter_lib/custom_check.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tools/linter_lib/custom_check.py b/tools/linter_lib/custom_check.py index 96adb02adb..4262ded376 100644 --- a/tools/linter_lib/custom_check.py +++ b/tools/linter_lib/custom_check.py @@ -261,6 +261,13 @@ def build_custom_checkers(by_lang): 'bad_lines': ['###some heading', '#another heading']}, ] # type: 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\(', 'description': 'The keyword "function" should be followed by a space'}, {'pattern': r'.*blueslip.warning\(.*',