mirror of
https://github.com/zulip/zulip.git
synced 2025-11-16 11:52:01 +00:00
custom_check: Enforce use of assert_length helper.
This commit is contained in:
committed by
Tim Abbott
parent
352634a851
commit
0ec905ed52
@@ -267,6 +267,12 @@ python_rules = RuleList(
|
|||||||
"good_lines": ["assertEqual(1, 2)"],
|
"good_lines": ["assertEqual(1, 2)"],
|
||||||
"bad_lines": ["assertEquals(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)",
|
"pattern": r"#\s*type:\s*ignore(?!\[[^][]+\] +# +\S)",
|
||||||
"exclude": {"tools/tests", "zerver/lib/test_runner.py", "zerver/tests"},
|
"exclude": {"tools/tests", "zerver/lib/test_runner.py", "zerver/tests"},
|
||||||
|
|||||||
Reference in New Issue
Block a user