diff options
author | Matus Valo <matusvalo@users.noreply.github.com> | 2022-06-16 11:32:10 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-16 11:32:10 +0200 |
commit | e666506158feab03630c37dfb9bf9fd498f7a52a (patch) | |
tree | ce1c4a9d3f18c440f4e81f0d4a8785acdcddf53f /pylint/checkers/stdlib.py | |
parent | 600a47e13e3df1ca42521c653ab0ebed5739d485 (diff) | |
download | pylint-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/checkers/stdlib.py')
-rw-r--r-- | pylint/checkers/stdlib.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/pylint/checkers/stdlib.py b/pylint/checkers/stdlib.py index 8aa5fc8f6..2e6f8c182 100644 --- a/pylint/checkers/stdlib.py +++ b/pylint/checkers/stdlib.py @@ -15,6 +15,7 @@ from astroid import nodes from pylint import interfaces from pylint.checkers import BaseChecker, DeprecatedMixin, utils +from pylint.typing import MessageDefinitionTuple if TYPE_CHECKING: from pylint.lint import PyLinter @@ -332,8 +333,11 @@ def _check_mode_str(mode): class StdlibChecker(DeprecatedMixin, BaseChecker): name = "stdlib" - msgs = { - **{k: v for k, v in DeprecatedMixin.msgs.items() if k[1:3] == "15"}, + msgs: dict[str, MessageDefinitionTuple] = { + **DeprecatedMixin.DEPRECATED_METHOD_MESSAGE, + **DeprecatedMixin.DEPRECATED_ARGUMENT_MESSAGE, + **DeprecatedMixin.DEPRECATED_CLASS_MESSAGE, + **DeprecatedMixin.DEPRECATED_DECORATOR_MESSAGE, "W1501": ( '"%s" is not a valid mode for open.', "bad-open-mode", |