Documentation
¶
Overview ¶
Package baseline owns deterministic, source-bound lint adoption waivers.
Index ¶
Constants ¶
const SchemaVersion = 1
SchemaVersion is the only accepted baseline document version.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AppliedFile ¶
type AppliedFile struct {
Path string
Diagnostics []rules.Diagnostic
Baselined []rules.Diagnostic
}
AppliedFile separates visible diagnostics from baseline-owned diagnostics.
type ApplyOptions ¶
ApplyOptions controls explicit stale and expiry policy.
type ApplyResult ¶
type ApplyResult struct {
Files []AppliedFile
Problems []Problem
}
ApplyResult is one complete baseline application over exact input files.
func Apply ¶
func Apply( root string, document Document, inputs []InputFile, options ApplyOptions, ) (ApplyResult, error)
Apply consumes exact baseline counts without hiding changed diagnostics.
type Document ¶
Document is one portable, deterministic lint baseline.
type Entry ¶
type Entry struct {
RuleID string `json:"rule_id"`
Path string `json:"path"`
MessageKey string `json:"message_key"`
SourceFingerprint string `json:"source_fingerprint"`
Count int `json:"count"`
Reason string `json:"reason,omitempty"`
ExpiresOn string `json:"expires_on,omitempty"`
}
Entry suppresses an exact number of structurally identical diagnostics.
type InputFile ¶
type InputFile struct {
File *source.File
Diagnostics []rules.Diagnostic
}
InputFile binds diagnostics to the exact immutable source used to produce them.
type ParseOptions ¶
type ParseOptions struct {
KnownRules []string
}
ParseOptions supplies registry identity for strict baseline validation.
type Problem ¶
type Problem struct {
Kind ProblemKind
Entry Entry
Remaining int
}
Problem is one deterministic baseline policy finding.
type ProblemKind ¶
type ProblemKind string
ProblemKind classifies an adoption waiver that no longer applies.
const ( // ProblemStale identifies an unused baseline count. ProblemStale ProblemKind = "stale" // ProblemExpired identifies an entry disabled by the configured cutoff. ProblemExpired ProblemKind = "expired" )