summaryrefslogtreecommitdiff
path: root/pylint/lint
diff options
context:
space:
mode:
authorPierre Sassoulas <pierre.sassoulas@gmail.com>2021-08-31 22:15:29 +0200
committerPierre Sassoulas <pierre.sassoulas@gmail.com>2021-09-01 08:27:04 +0200
commit5f96098d658fd9c1b59c5f1675033485e1b3bad0 (patch)
treecfb6d8f4d46f7aa05c73b6cc10cabde3c7eae5de /pylint/lint
parentca9eddc137936d1ffe83ec78d051f1b23f7c27b1 (diff)
downloadpylint-git-5f96098d658fd9c1b59c5f1675033485e1b3bad0.tar.gz
Remove the python3 porting mode from the codebase
It's possible to use the python3 porting checker from an older pylint version. But it's not evolving anymore and was costing resource to maintain.
Diffstat (limited to 'pylint/lint')
-rw-r--r--pylint/lint/pylinter.py36
-rw-r--r--pylint/lint/run.py14
2 files changed, 0 insertions, 50 deletions
diff --git a/pylint/lint/pylinter.py b/pylint/lint/pylinter.py
index 8582f7637..59276a50a 100644
--- a/pylint/lint/pylinter.py
+++ b/pylint/lint/pylinter.py
@@ -536,7 +536,6 @@ class PyLinter(
)
self.register_checker(self)
self._dynamic_plugins = set()
- self._python3_porting_mode = False
self._error_mode = False
self.load_provider_defaults()
if reporter:
@@ -755,45 +754,10 @@ class PyLinter(
self._error_mode = True
self.disable_noerror_messages()
self.disable("miscellaneous")
- if self._python3_porting_mode:
- self.disable("all")
- for msg_id in self._checker_messages("python3"):
- if msg_id.startswith("E"):
- self.enable(msg_id)
- config_parser = self.cfgfile_parser
- if config_parser.has_option("MESSAGES CONTROL", "disable"):
- value = config_parser.get("MESSAGES CONTROL", "disable")
- self.global_set_option("disable", value)
- else:
- self.disable("python3")
self.set_option("reports", False)
self.set_option("persistent", False)
self.set_option("score", False)
- def python3_porting_mode(self):
- """Disable all other checkers and enable Python 3 warnings."""
- self.disable("all")
- # re-enable some errors, or 'print', 'raise', 'async', 'await' will mistakenly lint fine
- self.enable("fatal") # F0001
- self.enable("astroid-error") # F0002
- self.enable("parse-error") # F0010
- self.enable("syntax-error") # E0001
- self.enable("python3")
- if self._error_mode:
- # The error mode was activated, using the -E flag.
- # So we'll need to enable only the errors from the
- # Python 3 porting checker.
- for msg_id in self._checker_messages("python3"):
- if msg_id.startswith("E"):
- self.enable(msg_id)
- else:
- self.disable(msg_id)
- config_parser = self.cfgfile_parser
- if config_parser.has_option("MESSAGES CONTROL", "disable"):
- value = config_parser.get("MESSAGES CONTROL", "disable")
- self.global_set_option("disable", value)
- self._python3_porting_mode = True
-
def list_messages_enabled(self):
emittable, non_emittable = self.msgs_store.find_emittable_messages()
enabled = []
diff --git a/pylint/lint/run.py b/pylint/lint/run.py
index ac4f586f4..d84ed2703 100644
--- a/pylint/lint/run.py
+++ b/pylint/lint/run.py
@@ -248,16 +248,6 @@ group are mutually exclusive.",
},
),
(
- "py3k",
- {
- "action": "callback",
- "callback": self.cb_python3_porting_mode,
- "help": "In Python 3 porting mode, all checkers will be "
- "disabled and only messages emitted by the porting "
- "checker will be displayed.",
- },
- ),
- (
"verbose",
{
"action": "callback",
@@ -469,9 +459,5 @@ group are mutually exclusive.",
print(check)
sys.exit(0)
- def cb_python3_porting_mode(self, *args, **kwargs):
- """Activate only the python3 porting checker."""
- self.linter.python3_porting_mode()
-
def cb_verbose_mode(self, *args, **kwargs):
self.verbose = True