from spotregen import Finding
finding = Finding("error", "ARCH01", "src/samplepkg/core/bad.py", "forbidden import")
print(finding.format())ERROR ARCH01 src/samplepkg/core/bad.py: forbidden import
One result of a check.
| Name | Type | Description |
|---|---|---|
| level | str | "error" (fails the check) or "warning". |
| code | str | Short stable code, for example "ARCH01". |
| where | str | The file or unit the finding is about. |
| message | str | What is wrong and, where possible, how to fix it. |
| path | str | None | Repository-relative POSIX path of the file to open, or None. Not part of format() and not compared. |
| line | int | None | 1-based line in path, or None when the check cannot tell. Not part of format() and not compared. |
| Name | Description |
|---|---|
| format | Render the finding as one line for a terminal. |
Render the finding as one line for a terminal.
| Name | Type | Description |
|---|---|---|
| str | str | LEVEL CODE where: message, the level padded to 7 and the code to 7 characters. |