Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename pylint.Run do_exit parameter to exit #3554

Merged
merged 2 commits into from
May 1, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ deps =
isort
pytest
commands =
pylint -rn --rcfile={toxinidir}/pylintrc --load-plugins=pylint.extensions.docparams, pylint.extensions.mccabe {envsitepackagesdir}/pylint
pylint -rn --rcfile={toxinidir}/pylintrc --load-plugins=pylint.extensions.docparams, pylint.extensions.mccabe {toxinidir}/pylint
# This would be greatly simplified by a solution for https://github.com/PyCQA/pylint/issues/352
pylint -rn --rcfile={toxinidir}/tests/.test_pylintrc --load-plugins=pylint.extensions.docparams, pylint.extensions.mccabe \
{toxinidir}/tests/message/ {toxinidir}/tests/extensions/ {toxinidir}/tests/utils/ {toxinidir}/tests/acceptance/ {toxinidir}/tests/conftest.py \
Expand Down