summaryrefslogtreecommitdiff
path: root/pylint/lint
diff options
context:
space:
mode:
authorJacob Walls <jacobtylerwalls@gmail.com>2022-11-11 14:20:55 -0500
committerGitHub <noreply@github.com>2022-11-11 20:20:55 +0100
commitb646ebc19e7c161cadfc620b8880b0cebe579545 (patch)
tree5c555c2d6940a7dbdad94e86da57b50b5fe20b35 /pylint/lint
parentc289271b81f45d0ea28ab02fce2fd2c21d90d491 (diff)
downloadpylint-git-b646ebc19e7c161cadfc620b8880b0cebe579545.tar.gz
Avoid deprecation warning in internal use of `may_be_emitted` (#7746)
* Refactor MessageDefinitionStore to accept py_version Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
Diffstat (limited to 'pylint/lint')
-rw-r--r--pylint/lint/pylinter.py25
1 files changed, 13 insertions, 12 deletions
diff --git a/pylint/lint/pylinter.py b/pylint/lint/pylinter.py
index 66455bfb1..9965607d4 100644
--- a/pylint/lint/pylinter.py
+++ b/pylint/lint/pylinter.py
@@ -299,18 +299,6 @@ class PyLinter(
self._dynamic_plugins: dict[str, ModuleType | ModuleNotFoundError | bool] = {}
"""Set of loaded plugin names."""
- # Attributes related to registering messages and their handling
- self.msgs_store = MessageDefinitionStore()
- self.msg_status = 0
- self._by_id_managed_msgs: list[ManagedMessage] = []
-
- # Attributes related to visiting files
- self.file_state = FileState("", self.msgs_store, is_base_filestate=True)
- self.current_name: str | None = None
- self.current_file: str | None = None
- self._ignore_file = False
- self._ignore_paths: list[Pattern[str]] = []
-
# Attributes related to stats
self.stats = LinterStats()
@@ -338,6 +326,19 @@ class PyLinter(
),
("RP0003", "Messages", report_messages_stats),
)
+
+ # Attributes related to registering messages and their handling
+ self.msgs_store = MessageDefinitionStore(self.config.py_version)
+ self.msg_status = 0
+ self._by_id_managed_msgs: list[ManagedMessage] = []
+
+ # Attributes related to visiting files
+ self.file_state = FileState("", self.msgs_store, is_base_filestate=True)
+ self.current_name: str | None = None
+ self.current_file: str | None = None
+ self._ignore_file = False
+ self._ignore_paths: list[Pattern[str]] = []
+
self.register_checker(self)
@property