| 32 | |
| 33 | @dataclass |
| 34 | class Finding: |
| 35 | severity: str # 'error' | 'warning' | 'info' |
| 36 | harness: str |
| 37 | path: Path |
| 38 | message: str |
| 39 | remediation: str = "" |
| 40 | |
| 41 | def render(self) -> str: |
| 42 | rel = self.path.relative_to(WORKTREE) if self.path.is_relative_to(WORKTREE) else self.path |
| 43 | tail = f"\n fix: {self.remediation}" if self.remediation else "" |
| 44 | return f"[{self.severity}] {self.harness}: {rel}: {self.message}{tail}" |
| 45 | |
| 46 | |
| 47 | @dataclass |