feat(cli): ruff-style output, implicit context defaults, --list-vars
- Finding format now follows file:line: RULEID [severity] message, matching ruff and other modern linters (GL003 [error] job "x": ...) - glint check and glint graph default to --branch main --source push when no context flag is given; rules:if: is always evaluated - --list-vars flag on both commands prints sorted KEY=VALUE of all collected variables (YAML, workflow-rule union, effective context) - CHANGELOG [Unreleased] promoted to [0.2.11]; README badge updated; ROADMAP marks newly shipped items Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+13
-10
@@ -24,25 +24,28 @@ type Finding struct {
|
||||
}
|
||||
|
||||
func (f Finding) String() string {
|
||||
loc := ""
|
||||
var loc string
|
||||
if f.File != "" {
|
||||
if f.Line > 0 {
|
||||
loc = fmt.Sprintf(" (%s:%d)", f.File, f.Line)
|
||||
loc = fmt.Sprintf("%s:%d: ", f.File, f.Line)
|
||||
} else {
|
||||
loc = fmt.Sprintf(" (%s)", f.File)
|
||||
loc = fmt.Sprintf("%s: ", f.File)
|
||||
}
|
||||
}
|
||||
ruleStr := ""
|
||||
|
||||
rule := ""
|
||||
if f.Rule != "" {
|
||||
ruleStr = " " + f.Rule
|
||||
rule = f.Rule + " "
|
||||
}
|
||||
|
||||
sev := "[" + strings.ToLower(string(f.Severity)) + "]"
|
||||
|
||||
msg := f.Message
|
||||
if f.Job != "" {
|
||||
return fmt.Sprintf("[%s] job %q%s%s: %s", f.Severity, f.Job, loc, ruleStr, f.Message)
|
||||
msg = fmt.Sprintf("job %q: %s", f.Job, f.Message)
|
||||
}
|
||||
if loc != "" || ruleStr != "" {
|
||||
return fmt.Sprintf("[%s]%s%s: %s", f.Severity, loc, ruleStr, f.Message)
|
||||
}
|
||||
return fmt.Sprintf("[%s] %s", f.Severity, f.Message)
|
||||
|
||||
return fmt.Sprintf("%s%s%s %s", loc, rule, sev, msg)
|
||||
}
|
||||
|
||||
// Lint runs all rules against p and returns findings sorted by job name.
|
||||
|
||||
Reference in New Issue
Block a user