summaryrefslogtreecommitdiff
path: root/pylint/message
diff options
context:
space:
mode:
authorMatus Valo <matusvalo@users.noreply.github.com>2022-06-16 11:32:10 +0200
committerGitHub <noreply@github.com>2022-06-16 11:32:10 +0200
commite666506158feab03630c37dfb9bf9fd498f7a52a (patch)
treece1c4a9d3f18c440f4e81f0d4a8785acdcddf53f /pylint/message
parent600a47e13e3df1ca42521c653ab0ebed5739d485 (diff)
downloadpylint-git-e666506158feab03630c37dfb9bf9fd498f7a52a.tar.gz
Add support of sharing message in multiple checkers. Fix DeprecatedChecker example (#6693)
* Move message definitions from DeprecatedMixin * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Added typing and fixed unittests * Make DEPRECATED_MSGS and DEPRECATED_IMPORT_MSG class variables to make pylint happy * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Introduce shared messages * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Change Message codes in DeprecatedMixin to W49XX * Make mypy happy * Make pylint happy * Add support for building documentation for shared messages * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Make isort happy * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Circuvent isort * Move shared to extra message options and fix tests * Update deprecation_checker example * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update doc/exts/pylint_messages.py Co-authored-by: Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> * Update doc/exts/pylint_messages.py Co-authored-by: Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> * Make messages static class attributes * Keep MessageDefinition backward compatible * Apply suggestions from code review Co-authored-by: Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Daniël van Noord <13665637+DanielNoord@users.noreply.github.com>
Diffstat (limited to 'pylint/message')
-rw-r--r--pylint/message/message_definition.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/pylint/message/message_definition.py b/pylint/message/message_definition.py
index 714ce7efa..3b403b008 100644
--- a/pylint/message/message_definition.py
+++ b/pylint/message/message_definition.py
@@ -18,6 +18,7 @@ if TYPE_CHECKING:
class MessageDefinition:
+ # pylint: disable-next=too-many-arguments
def __init__(
self,
checker: BaseChecker,
@@ -29,6 +30,7 @@ class MessageDefinition:
minversion: tuple[int, int] | None = None,
maxversion: tuple[int, int] | None = None,
old_names: list[tuple[str, str]] | None = None,
+ shared: bool = False,
) -> None:
self.checker_name = checker.name
self.check_msgid(msgid)
@@ -39,6 +41,7 @@ class MessageDefinition:
self.scope = scope
self.minversion = minversion
self.maxversion = maxversion
+ self.shared = shared
self.old_names: list[tuple[str, str]] = []
if old_names:
for old_msgid, old_symbol in old_names: