Method: pylint.reporters.text.TextReporter.on_set_current_module
Calls: 2213, Exceptions: 0, Paths: 3Back
Path 1: 2209 calls (1.0)
'/Users/andrehora/Documents/git/projects-pathspotter/pylint/pylint/testutils/testing_pylintrc' (682) 'Command line' (252) 'Command line or configurati...
None (1570) '/Users/andrehora/Documents/git/projects-pathspotter/pylint/tests/config/file_to_lint.py' (100) '/Users/andrehora/Documents/git/projects-p...
None (2209)
1def on_set_current_module(self, module: str, filepath: str | None) -> None:
2 """Set the format template to be used and check for unrecognized arguments."""
3 template = str(self.linter.config.msg_template or self._template)
4
5 # Return early if the template is the same as the previous one
6 if template == self._template:
7 return
8
9 # Set template to the currently selected template
10 self._template = template
11
12 # Check to see if all parameters in the template are attributes of the Message
13 arguments = re.findall(r"\{(\w+?)(:.*)?\}", template)
14 for argument in arguments:
15 if argument[0] not in MESSAGE_FIELDS:
16 warnings.warn(
17 f"Don't recognize the argument '{argument[0]}' in the --msg-template. "
18 "Are you sure it is supported on the current version of pylint?"
19 )
20 template = re.sub(r"\{" + argument[0] + r"(:.*?)?\}", "", template)
21 self._fixed_template = template
Path 2: 3 calls (0.0)
'my_mod' (2) '0123' (1)
None (3)
1def on_set_current_module(self, module: str, filepath: str | None) -> None:
2 """Set the format template to be used and check for unrecognized arguments."""
3 template = str(self.linter.config.msg_template or self._template)
4
5 # Return early if the template is the same as the previous one
6 if template == self._template:
7 return
8
9 # Set template to the currently selected template
10 self._template = template
11
12 # Check to see if all parameters in the template are attributes of the Message
13 arguments = re.findall(r"\{(\w+?)(:.*)?\}", template)
14 for argument in arguments:
15 if argument[0] not in MESSAGE_FIELDS:
16 warnings.warn(
17 f"Don't recognize the argument '{argument[0]}' in the --msg-template. "
18 "Are you sure it is supported on the current version of pylint?"
19 )
20 template = re.sub(r"\{" + argument[0] + r"(:.*?)?\}", "", template)
21 self._fixed_template = template
Path 3: 1 calls (0.0)
'my_mod' (1)
None (1)
1def on_set_current_module(self, module: str, filepath: str | None) -> None:
2 """Set the format template to be used and check for unrecognized arguments."""
3 template = str(self.linter.config.msg_template or self._template)
4
5 # Return early if the template is the same as the previous one
6 if template == self._template:
7 return
8
9 # Set template to the currently selected template
10 self._template = template
11
12 # Check to see if all parameters in the template are attributes of the Message
13 arguments = re.findall(r"\{(\w+?)(:.*)?\}", template)
14 for argument in arguments:
15 if argument[0] not in MESSAGE_FIELDS:
16 warnings.warn(
17 f"Don't recognize the argument '{argument[0]}' in the --msg-template. "
18 "Are you sure it is supported on the current version of pylint?"
19 )
20 template = re.sub(r"\{" + argument[0] + r"(:.*?)?\}", "", template)
21 self._fixed_template = template