Produce an error for an import ignored due to --follow_imports=error
(
manager: BuildManager, line: int, caller_state: State | None, id: str, path: str
)
| 3982 | |
| 3983 | |
| 3984 | def skipping_module( |
| 3985 | manager: BuildManager, line: int, caller_state: State | None, id: str, path: str |
| 3986 | ) -> None: |
| 3987 | """Produce an error for an import ignored due to --follow_imports=error""" |
| 3988 | assert caller_state, (id, path) |
| 3989 | save_import_context = manager.errors.import_context() |
| 3990 | manager.errors.set_import_context(caller_state.import_context) |
| 3991 | manager.errors.set_file(caller_state.xpath, caller_state.id, manager.options) |
| 3992 | manager.error(line, f'Import of "{id}" ignored') |
| 3993 | manager.note( |
| 3994 | line, "(Using --follow-imports=error, module not passed on command line)", only_once=True |
| 3995 | ) |
| 3996 | manager.errors.set_import_context(save_import_context) |
| 3997 | |
| 3998 | |
| 3999 | def skipping_ancestor(manager: BuildManager, id: str, path: str, ancestor_for: State) -> None: |
no test coverage detected
searching dependent graphs…