INNER CODE UNIT · Python
_issues_from_stdin
f-droid/fdroidclient · tools/checkstyle-to-codeclimate.py:147
def _issues_from_stdin(base_dir: Optional[str]) -> List[Issue]:
data = sys.stdin.read()
try:
root = ET.fromstring(data)
except ET.ParseError as e:
raise SystemExit(f"Failed to parse XML from stdin: {e}") from e
issues: List[Issue] = []
for file_elem in root.findall("file"):
file_path = file_elem.get("name")
if not file_path:
continue
rel_path = _relativize(file_path, base_dir)
for err in file_elem.findall("error"):
line = err.get("line") or "1"
message = err.get("message") or "No description provided by Checkstyle."
severity_raw = (err.get("severity") or "").lower()
severity = CONVERSION_MAP.get(severity_raw, "info")
source = err.get("source")