feat(cli): colorized, columnized text output with line:col locations
Replace the per-line fmt.Println loop with writeTextFindings() in cmd/glint/output.go. The new renderer: - Aligns all findings into four space-separated columns: location, rule ID, severity, message — widths computed from the full finding set so all lines are flush - Colors severity words when stdout is a TTY and NO_COLOR is not set: red+bold for "error", orange+bold for "warning"; location dimmed; rule ID bold - Formats location as file:line:col when column is known, file:line otherwise, falling back to just file To populate column numbers, add Column int to model.Job (set from keyNode.Column in the YAML parser) and Finding.Column (set during the checkJob source-location attachment pass and in the ten cross-job check sites that explicitly set Line: job.Line). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -53,6 +53,7 @@ func checkNeeds(p *model.Pipeline, skipped map[string]bool) []Finding {
|
||||
Job: name,
|
||||
File: job.File,
|
||||
Line: job.Line,
|
||||
Column: job.Column,
|
||||
Message: fmt.Sprintf("needs unknown job %q", entry.job),
|
||||
})
|
||||
continue
|
||||
@@ -71,6 +72,7 @@ func checkNeeds(p *model.Pipeline, skipped map[string]bool) []Finding {
|
||||
Job: name,
|
||||
File: job.File,
|
||||
Line: job.Line,
|
||||
Column: job.Column,
|
||||
Message: fmt.Sprintf(
|
||||
"needs %q which is in a later stage (%q after %q)",
|
||||
entry.job, neededJob.Stage, job.Stage,
|
||||
@@ -111,6 +113,7 @@ func checkRulesNeeds(p *model.Pipeline, skipped map[string]bool) []Finding {
|
||||
Job: name,
|
||||
File: job.File,
|
||||
Line: job.Line,
|
||||
Column: job.Column,
|
||||
Message: fmt.Sprintf(
|
||||
"rules[%d].needs: references unknown job %q",
|
||||
i, entry.job,
|
||||
@@ -171,6 +174,7 @@ func detectNeedsCycles(graph map[string][]string, jobs map[string]model.Job) []F
|
||||
Job: name,
|
||||
File: j.File,
|
||||
Line: j.Line,
|
||||
Column: j.Column,
|
||||
Message: fmt.Sprintf("circular dependency in needs: %v → %s", path, name),
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user