feat(cli): --no-warn, new exit codes, glint render, and graph --no-skipped
Exit codes (breaking change from exit 1): - 0 clean (no findings) - 2 one or more errors - 10 one or more warnings, no errors Errors take precedence over warnings. glint check --no-warn: Discard warning findings before output and exit-code calculation. Mixed pipelines (errors + warnings) still exit 2 but only errors print. Warnings-only pipelines exit 0 with "OK" when --no-warn is set. glint render <PIPELINE>: New subcommand. Resolves all include: and extends: chains, then writes a single flat .gitlab-ci.yml (default: rendered.gitlab-ci.yml, or stdout with --output -). Strips consumed keys (include:, extends:). Template jobs (.) are retained. Flags: --output, --token, --gitlab-url, --cache-dir, --offline, --proxy (all with .glint.yml fallback). To support render, Resolve() now writes the merged raw map back to p.RawJobs[name] and also preserves j.Column from the original job. glint graph --no-skipped: Removes jobs that evaluate to JobSkipped in the given context before any graph function sees the pipeline. Works for tree, pipeline (SVG, HTML, Mermaid), includes, and all modes. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -80,12 +80,15 @@ func Resolve(p *model.Pipeline) ([]ExtendWarning, error) {
|
||||
return extWarnings, fmt.Errorf("job %q: re-decoding merged definition: %w", name, err)
|
||||
}
|
||||
j.Name = name
|
||||
// Preserve source location — File/Line are not part of the YAML map
|
||||
// Preserve source location — these fields are not part of the YAML map
|
||||
// and are lost during the encode/decode round-trip.
|
||||
orig := p.Jobs[name]
|
||||
j.File = orig.File
|
||||
j.Line = orig.Line
|
||||
j.Column = orig.Column
|
||||
p.Jobs[name] = j
|
||||
// Write merged raw map back so p.RawJobs always reflects post-extends state.
|
||||
p.RawJobs[name] = merged
|
||||
}
|
||||
|
||||
return extWarnings, nil
|
||||
|
||||
Reference in New Issue
Block a user