custom_check: Improve check for exit(...) call in management commands.

It's better for this to catch all exit(...) calls with non-zero exit
code, given the purpose is to catch all exits with failure, as opposed
to only exit(1).
This commit is contained in:
Mateusz Mandera
2021-11-14 19:44:29 +01:00
committed by Alex Vandiver
parent 7cc345d7b1
commit 3688ff38bd

View File

@@ -456,7 +456,7 @@ python_rules = RuleList(
],
},
{
"pattern": "exit[(]1[)]",
"pattern": r"exit[(][1-9]\d*[)]",
"include_only": {"/management/commands/"},
"description": "Raise CommandError to exit with failure in management commands",
"exclude": {"zerver/management/commands/process_queue.py"},