diff --git a/riff/riff.py b/riff/riff.py index b080bd1..0142a97 100644 --- a/riff/riff.py +++ b/riff/riff.py @@ -179,7 +179,7 @@ def main( # dead: disable for violation in filtered_violations: logger.error(violation) if print_github_annotation: - print(violation.to_github_annotation) # noqa: T201 + print(violation.github_annotation) # noqa: T201 raise typer.Exit(1) diff --git a/riff/violation.py b/riff/violation.py index 75f78c4..1676196 100644 --- a/riff/violation.py +++ b/riff/violation.py @@ -31,7 +31,7 @@ class Violation(NamedTuple): column_end: int | None = None @property - def to_github_annotation(self: "Violation") -> str: + def github_annotation(self: "Violation") -> str: relative_path = self.path.relative_to(Path.cwd()) annotation_parts = [f'::error file={relative_path}', f'line={self.line_start}'] @@ -44,7 +44,7 @@ def to_github_annotation(self: "Violation") -> str: if self.column_end: annotation_parts.append(f'endColumn={self.column_end}') - ','.join(annotation_parts) + '::"Ruff ({self.error_code})"' + return ','.join(annotation_parts) + f'::"Ruff ({self.error_code})"' @staticmethod def parse(raw: dict) -> "Violation":