Method: pylint.lint.pylinter.PyLinter._lint_file
Calls: 1304, Exceptions: 2, Paths: 4Back
Path 1: 720 calls (0.55)
FileItem (720)
Module (720)
partial (720)
1def _lint_file(
2 self,
3 file: FileItem,
4 module: nodes.Module,
5 check_astroid_module: Callable[[nodes.Module], bool | None],
6 ) -> None:
7 """Lint a file using the passed utility function check_astroid_module).
8
9 :param FileItem file: data about the file
10 :param nodes.Module module: the ast module to lint
11 :param Callable check_astroid_module: callable checking an AST taking the following arguments
12 - ast: AST of the module
13 :raises AstroidError: for any failures stemming from astroid
14 """
15 self.set_current_module(file.name, file.filepath)
16 self._ignore_file = False
17 self.file_state = FileState(file.modpath, self.msgs_store, module)
18 # fix the current file (if the source file was not available or
19 # if it's actually a c extension)
20 self.current_file = module.file
21
22 try:
23 check_astroid_module(module)
24 except Exception as e:
25 raise astroid.AstroidError from e
26
27 # warn about spurious inline messages handling
28 spurious_messages = self.file_state.iter_spurious_suppression_messages(
29 self.msgs_store
30 )
31 for msgid, line, args in spurious_messages:
32 self.add_message(msgid, line, None, args)
Path 2: 582 calls (0.45)
FileItem (582)
Module (582)
partial (582)
1def _lint_file(
2 self,
3 file: FileItem,
4 module: nodes.Module,
5 check_astroid_module: Callable[[nodes.Module], bool | None],
6 ) -> None:
7 """Lint a file using the passed utility function check_astroid_module).
8
9 :param FileItem file: data about the file
10 :param nodes.Module module: the ast module to lint
11 :param Callable check_astroid_module: callable checking an AST taking the following arguments
12 - ast: AST of the module
13 :raises AstroidError: for any failures stemming from astroid
14 """
15 self.set_current_module(file.name, file.filepath)
16 self._ignore_file = False
17 self.file_state = FileState(file.modpath, self.msgs_store, module)
18 # fix the current file (if the source file was not available or
19 # if it's actually a c extension)
20 self.current_file = module.file
21
22 try:
23 check_astroid_module(module)
24 except Exception as e:
25 raise astroid.AstroidError from e
26
27 # warn about spurious inline messages handling
28 spurious_messages = self.file_state.iter_spurious_suppression_messages(
29 self.msgs_store
30 )
31 for msgid, line, args in spurious_messages:
32 self.add_message(msgid, line, None, args)
Path 3: 1 calls (0.0)
FileItem (1)
Module (1)
partial (1)
ValueError (1)
1def _lint_file(
2 self,
3 file: FileItem,
4 module: nodes.Module,
5 check_astroid_module: Callable[[nodes.Module], bool | None],
6 ) -> None:
7 """Lint a file using the passed utility function check_astroid_module).
8
9 :param FileItem file: data about the file
10 :param nodes.Module module: the ast module to lint
11 :param Callable check_astroid_module: callable checking an AST taking the following arguments
12 - ast: AST of the module
13 :raises AstroidError: for any failures stemming from astroid
14 """
15 self.set_current_module(file.name, file.filepath)
16 self._ignore_file = False
17 self.file_state = FileState(file.modpath, self.msgs_store, module)
18 # fix the current file (if the source file was not available or
19 # if it's actually a c extension)
20 self.current_file = module.file
21
22 try:
23 check_astroid_module(module)
24 except Exception as e:
25 raise astroid.AstroidError from e
26
27 # warn about spurious inline messages handling
28 spurious_messages = self.file_state.iter_spurious_suppression_messages(
29 self.msgs_store
30 )
31 for msgid, line, args in spurious_messages:
32 self.add_message(msgid, line, None, args)
Path 4: 1 calls (0.0)
FileItem (1)
Module (1)
partial (1)
AstroidError (1)
1def _lint_file(
2 self,
3 file: FileItem,
4 module: nodes.Module,
5 check_astroid_module: Callable[[nodes.Module], bool | None],
6 ) -> None:
7 """Lint a file using the passed utility function check_astroid_module).
8
9 :param FileItem file: data about the file
10 :param nodes.Module module: the ast module to lint
11 :param Callable check_astroid_module: callable checking an AST taking the following arguments
12 - ast: AST of the module
13 :raises AstroidError: for any failures stemming from astroid
14 """
15 self.set_current_module(file.name, file.filepath)
16 self._ignore_file = False
17 self.file_state = FileState(file.modpath, self.msgs_store, module)
18 # fix the current file (if the source file was not available or
19 # if it's actually a c extension)
20 self.current_file = module.file
21
22 try:
23 check_astroid_module(module)
24 except Exception as e:
25 raise astroid.AstroidError from e
26
27 # warn about spurious inline messages handling
28 spurious_messages = self.file_state.iter_spurious_suppression_messages(
29 self.msgs_store
30 )
31 for msgid, line, args in spurious_messages:
32 self.add_message(msgid, line, None, args)