feat(linter): glint explain, GL042 rules:if: reachability, GL043 inherit completeness
- `glint explain <RULE>`: new subcommand printing rule description, rationale, bad-YAML example and fix for every GL001–GL043 rule. `glint explain` (no arg) lists all rules with ID, severity, title. Rule IDs are case-insensitive. - GL042 (rules:if: evaluated reachability): warns when every rules:if: condition evaluates to false given the values of variables declared in the pipeline YAML, making the job statically unreachable. Conservative: only fires when all referenced variables are declared in YAML; predefined CI_* / GITLAB_* variables are skipped to avoid false positives. - GL043 (inherit: completeness): warns when inherit: default: is declared but there is no default: block in the pipeline (dead declaration), or when the list form names fields not set in the default: block. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -107,6 +107,18 @@ tasks:
|
||||
ignore_error: false
|
||||
- cmd: ./{{.BINARY}} check testdata/config_suppress/.gitlab-ci.yml
|
||||
ignore_error: false
|
||||
- cmd: ./{{.BINARY}} check testdata/static_dead_rules.yml
|
||||
ignore_error: false
|
||||
- cmd: ./{{.BINARY}} check testdata/inherit_dead.yml
|
||||
ignore_error: false
|
||||
- cmd: ./{{.BINARY}} check testdata/inherit_dead_fields.yml
|
||||
ignore_error: false
|
||||
- cmd: ./{{.BINARY}} explain GL007
|
||||
ignore_error: false
|
||||
- cmd: ./{{.BINARY}} explain gl042
|
||||
ignore_error: false
|
||||
- cmd: ./{{.BINARY}} explain
|
||||
ignore_error: false
|
||||
|
||||
lint-go:
|
||||
desc: Run go vet on all packages
|
||||
|
||||
Reference in New Issue
Block a user