Documentation
¶
Overview ¶
Package suppressdrift relocates code-anchored suppressions (nosec directives and file/line ignore rules) as the code they pin to moves through git history. Given the snippet a rule was created against, it finds where that snippet now lives — following file renames and line shifts via go-git blame and tree diffs — so the stored file path and line number stay accurate. When the snippet is gone from the current tree the rule is flagged for auto-deactivation.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Anchor ¶
type Anchor struct {
Key string // caller correlation key (e.g. fingerprint or uuid)
FilePath string
LineNumber int
Snippet string
}
Anchor is one suppression to relocate. Snippet is the code the rule is pinned to; FilePath/LineNumber are its last-known location.
type Result ¶
type Result struct {
Key string
FilePath string // current path (may differ from Anchor.FilePath on rename)
Line int // current 1-based line
Commit string // commit that last touched the anchored line (best-effort)
Gone bool // snippet not found anywhere in the working tree
Moved bool // path or line changed from the Anchor
}
Result is the reconciled location of an Anchor.