summaryrefslogtreecommitdiff
path: root/pylint/checkers/logging.py
diff options
context:
space:
mode:
authorDaniƫl van Noord <13665637+DanielNoord@users.noreply.github.com>2022-03-29 14:44:27 +0200
committerGitHub <noreply@github.com>2022-03-29 14:44:27 +0200
commit0bc45e9037416203bd11f83b84a906fcec1a47f0 (patch)
treeaed06a43f53926fdb2b4045b381e31df9f2247ac /pylint/checkers/logging.py
parent700752a03604e4fe1b73e5f4200649c157e6eaaa (diff)
downloadpylint-git-0bc45e9037416203bd11f83b84a906fcec1a47f0.tar.gz
Create an `Argument` class and allow convertion of optdict into them (#5584)
* Use config initialization of ``_ArgumentsManager`` * Allow ``BaseChecker`` to register on a ``_ArgumentsManager`` * Use the ``argparse`` config handler in ``logging.py`` and add tests
Diffstat (limited to 'pylint/checkers/logging.py')
-rw-r--r--pylint/checkers/logging.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/pylint/checkers/logging.py b/pylint/checkers/logging.py
index 743f40db8..d9d73d3c1 100644
--- a/pylint/checkers/logging.py
+++ b/pylint/checkers/logging.py
@@ -144,15 +144,18 @@ class LoggingChecker(checkers.BaseChecker):
),
)
+ def __init__(self, linter: "PyLinter") -> None:
+ super().__init__(linter=linter, future_option_parsing=True)
+
def visit_module(self, _: nodes.Module) -> None:
"""Clears any state left in this checker from last module checked."""
# The code being checked can just as easily "import logging as foo",
# so it is necessary to process the imports and store in this field
# what name the logging module is actually given.
self._logging_names: Set[str] = set()
- logging_mods = self.config.logging_modules
+ logging_mods = self.linter.namespace.logging_modules
- self._format_style = self.config.logging_format_style
+ self._format_style = self.linter.namespace.logging_format_style
self._logging_modules = set(logging_mods)
self._from_imports = {}