Method: pylint.lint.expand_modules._modpath_from_file
Calls: 160, Exceptions: 0, Paths: 1Back
Path 1: 160 calls (1.0)
'/Users/andrehora/Documents/git/projects-pathspotter/pylint/tests/regrtest_data/directory/package/module.py' (18) '/Users/andrehora/Documents/git/proj...
False (153) True (7)
['.', '/Users/andrehora/Documents/git/projects-pathspotter/pylint', '/Users/andrehora/Documents/git/projects-pathspotter/pylint', '/Users/andrehora/Do...
['package', 'module'] (13) ['package', 'subpackage', '__init__'] (13) ['package', 'subpackage', 'module'] (13) ['regrtest_data', 'directory', 'package...
1def _modpath_from_file(filename: str, is_namespace: bool, path: list[str]) -> list[str]:
2 def _is_package_cb(inner_path: str, parts: list[str]) -> bool:
3 return modutils.check_modpath_has_init(inner_path, parts) or is_namespace
4
5 return modutils.modpath_from_file_with_callback( # type: ignore[no-any-return]
6 filename, path=path, is_package_cb=_is_package_cb
7 )