gui.model.Location

gui.model.Location(label, path, line)

Where to open a finding.

Attributes

Name Type Description
label str The text of the Where column: path:line, path or the place.
path Path | None The absolute file to open, or None if the finding names no file.
line int | None The 1-based line, or None.

Examples

from spotregen import Finding
from spotregen.gui.model import finding_location

finding = Finding("error", "ARCH01", "src/a.py", "bad", path="src/a.py", line=3)
print(finding_location(finding, "/repo"))
Location(label='src/a.py:3', path=PosixPath('/repo/src/a.py'), line=3)