Skip to content

Commit

Permalink
Revert pylint.Run's exit parameter to do_exit
Browse files Browse the repository at this point in the history
This has been inadvertently changed several releases ago to ``do_exit``.

Close #3533
  • Loading branch information
PCManticore committed May 1, 2020
1 parent 90d4215 commit a02b189
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
6 changes: 6 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -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?
===========================

Expand Down
6 changes: 4 additions & 2 deletions pylint/lint/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion tests/benchmark/test_baseline_benchmarks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'"
Expand Down
6 changes: 3 additions & 3 deletions tests/lint/unittest_lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"])
Expand All @@ -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"])
Expand All @@ -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"]

Expand Down

0 comments on commit a02b189

Please sign in to comment.