Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Directive ¶
type Directive struct {
Token *token.Token // The comment token itself
Line int // Target line number (the line being suppressed)
RuleIDs []string // Empty means all rules
// UsedIDs tracks which specific rule IDs have been used (suppressed a diagnostic
// or flagged as required-rule). For all-rules directives (empty RuleIDs),
// any entry means the directive was used.
UsedIDs map[string]bool
}
Directive represents a parsed ghasec-ignore comment.
func Collect ¶
Collect walks the token chain from tk forward and returns all ignore directives. tk should be the first token in the chain (walk backward from any token to find it).
func (*Directive) IsFullyUsed ¶
IsFullyUsed reports whether the entire directive has been used. For all-rules directives, any usage counts. For specific-rule directives, all rule IDs must be used.
func (*Directive) IsUsed ¶
IsUsed reports whether the directive (or a specific rule ID) has been used.
func (*Directive) KeywordToken ¶
KeywordToken returns a synthetic token pointing to the "ghasec-ignore" keyword within the comment. Used for diagnostic positioning on all-rules directives.
Click to show internal directories.
Click to hide internal directories.