diff --git a/tools/linter_lib/custom_check.py b/tools/linter_lib/custom_check.py index 7f0faeeedd..3b48a965c3 100644 --- a/tools/linter_lib/custom_check.py +++ b/tools/linter_lib/custom_check.py @@ -267,6 +267,12 @@ python_rules = RuleList( "good_lines": ["assertEqual(1, 2)"], "bad_lines": ["assertEquals(1, 2)"], }, + { + "pattern": "assertEqual[(]len[(][^ ]*[)],", + "description": "Use the assert_length helper instead of assertEqual(len(..), ..).", + "good_lines": ["assert_length(data, 2)"], + "bad_lines": ["assertEqual(len(data), 2)"], + }, { "pattern": r"#\s*type:\s*ignore(?!\[[^][]+\] +# +\S)", "exclude": {"tools/tests", "zerver/lib/test_runner.py", "zerver/tests"},