Method: pylint.config.find_default_config_files._toml_has_config
Calls: 4, Exceptions: 1, Paths: 2Back
Path 1: 3 calls (0.75)
PosixPath (3)
False (2) True (1)
1def _toml_has_config(path: Path | str) -> bool:
2 with open(path, mode="rb") as toml_handle:
3 try:
4 content = tomllib.load(toml_handle)
5 except tomllib.TOMLDecodeError as error:
6 print(f"Failed to load '{path}': {error}")
7 return False
8 return "pylint" in content.get("tool", [])
Path 2: 1 calls (0.25)
PosixPath (1)
TOMLDecodeError (1)
1def _toml_has_config(path: Path | str) -> bool:
2 with open(path, mode="rb") as toml_handle:
3 try:
4 content = tomllib.load(toml_handle)
5 except tomllib.TOMLDecodeError as error:
6 print(f"Failed to load '{path}': {error}")
7 return False
8 return "pylint" in content.get("tool", [])