Method: pylint.checkers.logging.LoggingChecker.visit_module
Calls: 1124, Exceptions: 0, Paths: 2Back
Path 1: 1123 calls (1.0)
Module (1123)
1def visit_module(self, _: nodes.Module) -> None:
2 """Clears any state left in this checker from last module checked."""
3 # The code being checked can just as easily "import logging as foo",
4 # so it is necessary to process the imports and store in this field
5 # what name the logging module is actually given.
6 self._logging_names: set[str] = set()
7 logging_mods = self.linter.config.logging_modules
8
9 self._format_style = self.linter.config.logging_format_style
10
11 self._logging_modules = set(logging_mods)
12 self._from_imports = {}
13 for logging_mod in logging_mods:
14 parts = logging_mod.rsplit(".", 1)
15 if len(parts) > 1:
16 self._from_imports[parts[0]] = parts[1]
Path 2: 1 calls (0.0)
Module (1)
1def visit_module(self, _: nodes.Module) -> None:
2 """Clears any state left in this checker from last module checked."""
3 # The code being checked can just as easily "import logging as foo",
4 # so it is necessary to process the imports and store in this field
5 # what name the logging module is actually given.
6 self._logging_names: set[str] = set()
7 logging_mods = self.linter.config.logging_modules
8
9 self._format_style = self.linter.config.logging_format_style
10
11 self._logging_modules = set(logging_mods)
12 self._from_imports = {}
13 for logging_mod in logging_mods:
14 parts = logging_mod.rsplit(".", 1)
15 if len(parts) > 1:
16 self._from_imports[parts[0]] = parts[1]