Method: pylint.lint.pylinter.PyLinter._lint_files
Calls: 1077, Exceptions: 2, Paths: 6Back
Path 1: 1056 calls (0.98)
dict (1056)
partial (1056)
1def _lint_files(
2 self,
3 ast_mapping: dict[FileItem, nodes.Module | None],
4 check_astroid_module: Callable[[nodes.Module], bool | None],
5 ) -> None:
6 """Lint all AST modules from a mapping.."""
7 for fileitem, module in ast_mapping.items():
8 if module is None:
9 continue
10 try:
11 self._lint_file(fileitem, module, check_astroid_module)
12 except Exception as ex: # pylint: disable=broad-except
13 template_path = prepare_crash_report(
14 ex, fileitem.filepath, self.crash_file_path
15 )
16 msg = get_fatal_error_message(fileitem.filepath, template_path)
17 if isinstance(ex, astroid.AstroidError):
18 self.add_message(
19 "astroid-error", args=(fileitem.filepath, msg), confidence=HIGH
20 )
21 else:
22 self.add_message("fatal", args=msg, confidence=HIGH)
Path 2: 8 calls (0.01)
{} (8)
partial (8)
1def _lint_files(
2 self,
3 ast_mapping: dict[FileItem, nodes.Module | None],
4 check_astroid_module: Callable[[nodes.Module], bool | None],
5 ) -> None:
6 """Lint all AST modules from a mapping.."""
7 for fileitem, module in ast_mapping.items():
8 if module is None:
9 continue
10 try:
11 self._lint_file(fileitem, module, check_astroid_module)
12 except Exception as ex: # pylint: disable=broad-except
13 template_path = prepare_crash_report(
14 ex, fileitem.filepath, self.crash_file_path
15 )
16 msg = get_fatal_error_message(fileitem.filepath, template_path)
17 if isinstance(ex, astroid.AstroidError):
18 self.add_message(
19 "astroid-error", args=(fileitem.filepath, msg), confidence=HIGH
20 )
21 else:
22 self.add_message("fatal", args=msg, confidence=HIGH)
Path 3: 8 calls (0.01)
{FileItem(name='syntax_error', filepath='/Users/andrehora/Documents/git/projects-pathspotter/pylint/tests/regrtest_data/syntax_error.py', modpath='syn...
partial (8)
1def _lint_files(
2 self,
3 ast_mapping: dict[FileItem, nodes.Module | None],
4 check_astroid_module: Callable[[nodes.Module], bool | None],
5 ) -> None:
6 """Lint all AST modules from a mapping.."""
7 for fileitem, module in ast_mapping.items():
8 if module is None:
9 continue
10 try:
11 self._lint_file(fileitem, module, check_astroid_module)
12 except Exception as ex: # pylint: disable=broad-except
13 template_path = prepare_crash_report(
14 ex, fileitem.filepath, self.crash_file_path
15 )
16 msg = get_fatal_error_message(fileitem.filepath, template_path)
17 if isinstance(ex, astroid.AstroidError):
18 self.add_message(
19 "astroid-error", args=(fileitem.filepath, msg), confidence=HIGH
20 )
21 else:
22 self.add_message("fatal", args=msg, confidence=HIGH)
Path 4: 3 calls (0.0)
dict (3)
partial (3)
1def _lint_files(
2 self,
3 ast_mapping: dict[FileItem, nodes.Module | None],
4 check_astroid_module: Callable[[nodes.Module], bool | None],
5 ) -> None:
6 """Lint all AST modules from a mapping.."""
7 for fileitem, module in ast_mapping.items():
8 if module is None:
9 continue
10 try:
11 self._lint_file(fileitem, module, check_astroid_module)
12 except Exception as ex: # pylint: disable=broad-except
13 template_path = prepare_crash_report(
14 ex, fileitem.filepath, self.crash_file_path
15 )
16 msg = get_fatal_error_message(fileitem.filepath, template_path)
17 if isinstance(ex, astroid.AstroidError):
18 self.add_message(
19 "astroid-error", args=(fileitem.filepath, msg), confidence=HIGH
20 )
21 else:
22 self.add_message("fatal", args=msg, confidence=HIGH)
Path 5: 1 calls (0.0)
dict (1)
partial (1)
ValueError (1)
1def _lint_files(
2 self,
3 ast_mapping: dict[FileItem, nodes.Module | None],
4 check_astroid_module: Callable[[nodes.Module], bool | None],
5 ) -> None:
6 """Lint all AST modules from a mapping.."""
7 for fileitem, module in ast_mapping.items():
8 if module is None:
9 continue
10 try:
11 self._lint_file(fileitem, module, check_astroid_module)
12 except Exception as ex: # pylint: disable=broad-except
13 template_path = prepare_crash_report(
14 ex, fileitem.filepath, self.crash_file_path
15 )
16 msg = get_fatal_error_message(fileitem.filepath, template_path)
17 if isinstance(ex, astroid.AstroidError):
18 self.add_message(
19 "astroid-error", args=(fileitem.filepath, msg), confidence=HIGH
20 )
21 else:
22 self.add_message("fatal", args=msg, confidence=HIGH)
Path 6: 1 calls (0.0)
dict (1)
partial (1)
AstroidError (1)
1def _lint_files(
2 self,
3 ast_mapping: dict[FileItem, nodes.Module | None],
4 check_astroid_module: Callable[[nodes.Module], bool | None],
5 ) -> None:
6 """Lint all AST modules from a mapping.."""
7 for fileitem, module in ast_mapping.items():
8 if module is None:
9 continue
10 try:
11 self._lint_file(fileitem, module, check_astroid_module)
12 except Exception as ex: # pylint: disable=broad-except
13 template_path = prepare_crash_report(
14 ex, fileitem.filepath, self.crash_file_path
15 )
16 msg = get_fatal_error_message(fileitem.filepath, template_path)
17 if isinstance(ex, astroid.AstroidError):
18 self.add_message(
19 "astroid-error", args=(fileitem.filepath, msg), confidence=HIGH
20 )
21 else:
22 self.add_message("fatal", args=msg, confidence=HIGH)