custom_check: Enforce use of assert_length helper.

This commit is contained in:
Abhijeet Prasad Bodas 2021-05-10 20:04:23 +05:30 committed by Tim Abbott
parent 352634a851
commit 0ec905ed52
1 changed files with 6 additions and 0 deletions

View File

@ -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"},