INNER CODE UNIT · Python
convert_paths
f-droid/fdroidclient · tools/checkstyle-to-codeclimate.py:182
def convert_paths(
inputs: Iterable[Union[pathlib.Path, str]], base_dir: Optional[str]
) -> List[Issue]:
issues: List[Issue] = []
for inp in inputs:
if inp == "-":
issues.extend(_issues_from_stdin(base_dir))
continue
path = pathlib.Path(str(inp))
if not path.is_file():
raise FileNotFoundError(f"Input file not found: {path}")
try:
for issue in _stream_issues_from_file(path, base_dir):
issues.append(issue)
except ET.ParseError as e:
raise SystemExit(f"Failed to parse XML '{path}': {e}") from e
return issues