From 071d6b95150c001df299b6a6db961ea1ce981585 Mon Sep 17 00:00:00 2001 From: firewave Date: Fri, 18 Oct 2024 17:32:03 +0200 Subject: [PATCH] enabled and fixed `consider-using-sys-exit` pylint warnings --- .pylintrc | 1 - addons/naming.py | 2 +- htmlreport/cppcheck-htmlreport | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.pylintrc b/.pylintrc index f5fdcd82414..025e38464c4 100644 --- a/.pylintrc +++ b/.pylintrc @@ -52,7 +52,6 @@ disable= consider-using-in, too-many-nested-blocks, too-many-public-methods, - consider-using-sys-exit, chained-comparison, too-many-instance-attributes, too-many-boolean-expressions, diff --git a/addons/naming.py b/addons/naming.py index 948f158b6f4..42a4237489e 100755 --- a/addons/naming.py +++ b/addons/naming.py @@ -17,7 +17,7 @@ def validate_regex(expr): re.compile(expr) except re.error: print('Error: "{}" is not a valid regular expression.'.format(expr)) - exit(1) + sys.exit(1) RE_VARNAME = None diff --git a/htmlreport/cppcheck-htmlreport b/htmlreport/cppcheck-htmlreport index 6e2f69f6e98..1d067b40953 100755 --- a/htmlreport/cppcheck-htmlreport +++ b/htmlreport/cppcheck-htmlreport @@ -653,7 +653,7 @@ def main() -> None: sys.argv[1] except IndexError: # no arguments give, print --help parser.print_help() - quit() + sys.exit(0) if not options.report_dir: parser.error('No report directory set.')