Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

custom lint checks: Avoid direct calls to rewire setters.

Steve Howellf9b7def09890
diff --git a/tools/linter_lib/custom_check.py b/tools/linter_lib/custom_check.py
index 20e6b4e5297..2c0e136e2ac 100644
--- a/tools/linter_lib/custom_check.py
+++ b/tools/linter_lib/custom_check.py
@@ -225,6 +225,11 @@ js_rules = RuleList(
"pattern": r"allowHTML|(?i:data-tippy-allowHTML)",
"description": "Never use Tippy.js allowHTML; for an HTML tooltip, get a DocumentFragment with ui_util.parse_html.",
},
+ {
+ "pattern": r"\.rewire_",
+ "description": "Never call rewire_* functions directly. Use override_rewire.",
+ "include_only": {"web/tests/"},
+ },
*whitespace_rules,
],
)