feat(linter): context-scoped needs:/dependencies: cross-checks
When glint check runs in single-context mode (--branch, --tag, --source, or --var), jobs that resolve to JobSkipped against that context are now excluded from needs: and dependencies: cross-job checks (GL027-GL031). This eliminates false-positive errors for jobs intentionally gated to specific pipeline events (e.g. a deploy job with rules:if: CI_COMMIT_TAG no longer triggers GL027 on branch pipelines). linter.Lint now accepts a skipped map[string]bool (nil = check all jobs); checkNeeds and checkDependencies skip jobs present in the map. Multi-context mode (--context) passes nil, so all jobs are checked regardless of context. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -35,7 +35,7 @@ func TestSambaCI(t *testing.T) {
|
||||
t.Logf("extends warning: job %q extends unknown %q", w.Job, w.Base)
|
||||
}
|
||||
|
||||
findings := linter.Lint(p)
|
||||
findings := linter.Lint(p, nil)
|
||||
|
||||
for _, f := range findings {
|
||||
if f.Severity == linter.Error {
|
||||
@@ -78,7 +78,7 @@ func TestSambaCIEntryFiles(t *testing.T) {
|
||||
t.Logf("extends warning: job %q extends unknown %q", w.Job, w.Base)
|
||||
}
|
||||
|
||||
findings := linter.Lint(p)
|
||||
findings := linter.Lint(p, nil)
|
||||
for _, f := range findings {
|
||||
if f.Severity == linter.Error {
|
||||
t.Errorf("unexpected error finding: %s", f)
|
||||
|
||||
Reference in New Issue
Block a user