diff options
author | Claudiu Popa <pcmanticore@gmail.com> | 2020-05-05 14:05:26 +0200 |
---|---|---|
committer | Claudiu Popa <pcmanticore@gmail.com> | 2020-05-05 14:54:43 +0200 |
commit | 43449dea6ad4f77af3290b12ba5cbae83bfb98d8 (patch) | |
tree | b4f693afaafc92daa1e08de71cf7394e0b432165 | |
parent | 61e0e6b65476f083960ce5563745f337fb2454be (diff) | |
download | pylint-git-43449dea6ad4f77af3290b12ba5cbae83bfb98d8.tar.gz |
``pylint.Run`` accepts ``do_exit`` as a deprecated parameter
We need to allow various third party libraries that depend on `pylint` to still use
`do_exit` until they can move over to `exit`.
Close #3590
-rw-r--r-- | ChangeLog | 10 | ||||
-rw-r--r-- | pylint/lint/run.py | 14 |
2 files changed, 23 insertions, 1 deletions
@@ -21,6 +21,16 @@ Release date: TBA * Add `super-with-arguments` check for flagging instances of Python 2 style super calls. +What's New in Pylint 2.5.2? +=========================== + +Release date: 2020-05-05 + +* ``pylint.Run`` accepts ``do_exit`` as a deprecated parameter + + Close #3590 + + What's New in Pylint 2.5.1? =========================== diff --git a/pylint/lint/run.py b/pylint/lint/run.py index 704480569..ac63c8e44 100644 --- a/pylint/lint/run.py +++ b/pylint/lint/run.py @@ -3,6 +3,7 @@ import os import sys +import warnings from pylint import __pkginfo__, config, extensions, interfaces from pylint.lint.pylinter import PyLinter @@ -47,6 +48,9 @@ def cb_init_hook(optname, value): exec(value) # pylint: disable=exec-used +UNUSED_PARAM_SENTINEL = object() + + class Run: """helper class to use as main for pylint : @@ -67,7 +71,7 @@ group are mutually exclusive.", return 1 def __init__( - self, args, reporter=None, exit=True + self, args, reporter=None, exit=True, do_exit=UNUSED_PARAM_SENTINEL, ): # pylint: disable=redefined-builtin self._rcfile = None self._plugins = [] @@ -338,6 +342,14 @@ group are mutually exclusive.", linter.check(args) score_value = linter.generate_reports() + + if do_exit is not UNUSED_PARAM_SENTINEL: + warnings.warn( + "do_exit is deprecated and it is going to be removed in a future version.", + DeprecationWarning, + ) + exit = do_exit + if exit: if linter.config.exit_zero: sys.exit(0) |