From ec2053bf4d7b1f76c1c2a97b4c67833c8b62549a Mon Sep 17 00:00:00 2001 From: Claudiu Popa Date: Fri, 1 May 2020 08:39:18 +0200 Subject: Revert pylint.Run's `exit` parameter to ``do_exit`` This has been inadvertently changed several releases ago to ``do_exit``. Close #3533 --- ChangeLog | 6 ++++++ pylint/lint/run.py | 6 ++++-- tests/benchmark/test_baseline_benchmarks.py | 2 +- tests/lint/unittest_lint.py | 6 +++--- 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 58df80de3..3b83e4608 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 b3d0b9f76..1f92e68af 100644 --- a/pylint/lint/run.py +++ b/pylint/lint/run.py @@ -66,7 +66,9 @@ group are mutually exclusive.", 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 @@ group are mutually exclusive.", 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 5909cbd6b..d3e09f716 100644 --- a/tests/benchmark/test_baseline_benchmarks.py +++ b/tests/benchmark/test_baseline_benchmarks.py @@ -286,7 +286,7 @@ class TestEstablishBaselineBenchmarks: # 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 0afde2d23..462695169 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"] -- cgit v1.2.1