diff --git a/ChangeLog b/ChangeLog index 58df80de37..3b83e46082 100644 --- a/ChangeLog +++ b/ChangeLog @@ -11,6 +11,12 @@ Release date: TBA Close #3527 +* Revert pylint.Run's `exit` parameter to ``do_exit`` + + This has been inadvertently changed several releases ago to ``do_exit``. + + Close #3533 + What's New in Pylint 2.5.0? =========================== diff --git a/pylint/lint/run.py b/pylint/lint/run.py index b3d0b9f769..1f92e68af7 100644 --- a/pylint/lint/run.py +++ b/pylint/lint/run.py @@ -66,7 +66,9 @@ class Run: def _return_one(*args): # pylint: disable=unused-argument return 1 - def __init__(self, args, reporter=None, do_exit=True): + def __init__( + self, args, reporter=None, exit=True + ): # pylint: disable=redefined-builtin self._rcfile = None self._plugins = [] self.verbose = None @@ -337,7 +339,7 @@ def __init__(self, args, reporter=None, do_exit=True): linter.check(args) score_value = linter.generate_reports() - if do_exit: + if exit: if linter.config.exit_zero: sys.exit(0) else: diff --git a/tests/benchmark/test_baseline_benchmarks.py b/tests/benchmark/test_baseline_benchmarks.py index 5909cbd6b5..d3e09f7163 100644 --- a/tests/benchmark/test_baseline_benchmarks.py +++ b/tests/benchmark/test_baseline_benchmarks.py @@ -286,7 +286,7 @@ def test_baseline_benchmark_j1_all_checks_single_file(self, benchmark): # Just 1 file, but all Checkers/Extensions fileinfos = [self.empty_filepath] - runner = benchmark(Run, fileinfos, reporter=Reporter(), do_exit=False) + runner = benchmark(Run, fileinfos, reporter=Reporter(), exit=False) assert runner.linter.config.jobs == 1 print("len(runner.linter._checkers)", len(runner.linter._checkers)) assert len(runner.linter._checkers) > 1, "Should have more than 'master'" diff --git a/tests/lint/unittest_lint.py b/tests/lint/unittest_lint.py index 0afde2d233..462695169d 100644 --- a/tests/lint/unittest_lint.py +++ b/tests/lint/unittest_lint.py @@ -518,7 +518,7 @@ def test_load_plugin_command_line(): run = Run( ["--load-plugins", "dummy_plugin", join(REGRTEST_DATA_DIR, "empty.py")], - do_exit=False, + exit=False, ) assert ( len([ch.name for ch in run.linter.get_checkers() if ch.name == "dummy_plugin"]) @@ -534,7 +534,7 @@ def test_load_plugin_config_file(): config_path = join(REGRTEST_DATA_DIR, "dummy_plugin.rc") run = Run( - ["--rcfile", config_path, join(REGRTEST_DATA_DIR, "empty.py")], do_exit=False, + ["--rcfile", config_path, join(REGRTEST_DATA_DIR, "empty.py")], exit=False, ) assert ( len([ch.name for ch in run.linter.get_checkers() if ch.name == "dummy_plugin"]) @@ -556,7 +556,7 @@ def test_load_plugin_configuration(): "foo,bar", join(REGRTEST_DATA_DIR, "empty.py"), ], - do_exit=False, + exit=False, ) assert run.linter.config.black_list == ["foo", "bar", "bin"]