Documentation
¶
Overview ¶
Package validation contains provider-neutral validation diagnostics and their common output representations.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AffectedFiles ¶
AffectedFiles returns repository-relative files changed between HEAD and its merge-base with base. When base is empty, it uses the GitHub event's base SHA (when available), then the GitHub base branch, and finally origin/HEAD.
Deleted paths are intentionally retained. Callers can use them to decide whether a dependent validator must run, while skipping files that can no longer be read.
func ExcludePaths ¶
ExcludePaths removes paths matching any repository-relative glob pattern. Patterns use forward slashes and support doublestar (for example, "tests/fixtures/**") on every platform.
func IsAtmosConfigPath ¶
IsAtmosConfigPath reports whether path is one of the project-local Atmos configuration files read by the CLI configuration loader.
func Rich ¶
func Rich(report Report, options RichOptions) string
Rich renders a report as deterministic source excerpts. It intentionally degrades to a complete header-only finding when a source cannot be read; presentation must never hide a validation failure.
Types ¶
type Diagnostic ¶
type Diagnostic struct {
Source string
RuleID string
Severity Severity
Message string
File string
Line int
Column int
// EndLine and EndColumn optionally identify a multi-line finding. They are
// primarily used by human renderers and CI annotations; zero means the
// location ends at Line/Column.
EndLine int
EndColumn int
}
Diagnostic is a source location and message emitted by a validator.
type Report ¶
type Report struct {
Diagnostics []Diagnostic
FilesChecked int
Target string
RenderedDiagnostics string
}
Report is the complete result of one validator invocation.
func FromGCCText ¶
FromGCCText converts the location-bearing text produced by existing stack validation into normalized diagnostics. Lines that do not carry a source location become a single file-less finding so rich output never discards useful validation context.
func (Report) ToAnnotations ¶
func (r Report) ToAnnotations() []ci.Annotation
ToAnnotations maps the report to provider-neutral CI annotations.
type RichOptions ¶
RichOptions controls a human-oriented diagnostic rendering. Root resolves relative diagnostic paths, Width is the available terminal width (or zero for the standard fallback), and Color is normally derived from Atmos's terminal policy by callers.
func DefaultRichOptions ¶
func DefaultRichOptions(root string) RichOptions
DefaultRichOptions obtains the standard terminal capabilities. Keeping this separate lets tests and command callers supply deterministic settings.