feat(playbooks): standalone lint tool for playbook binding dirs
Fourth slice of docs/prds/eda-playbook-engine.md (t2db.12): the design doc's pre-merge collision layer, as a gopls-shaped standalone binary (cmd/archie-playbooks) rather than a Taskfile wrapper -- one binary, one schema source, mode-based entrypoints. - cmd/archie-playbooks: subcommand dispatch table from day one (lint now; an lsp/serve mode later slots in without restructuring), flag parsing only per organisation.md's cmd/ rule. - internal/app/archieplaybooks: the lint mode's composition -- collects directories, calls workflow.LoadPlaybookDirs (the daemon's own loader), reports findings. No second validation path: the linter agrees with runtime startup validation by construction. - Reuses LoadKindWorkflowsYAML/LoadLabelWorkflowsYAML/LoadPlaybookDirs directly; collision/malformed/invalid bindings exit non-zero. - Known limitation recorded: findings are file-granular, not line-granular (yaml.Unmarshal into map discards line numbers; a file:line diagnostic needs a yaml.Node upgrade, out of scope here). - Taskfile lint:playbooks target; PRD records the shipped shape and the file-granular caveat.
This commit is contained in:
1 parent
556038e7cb
commit
8c19555b4a
6 files changed
+353
No files matched your search
@@ -25,6 +25,20 @@ tasks:
|
||||
cmds:
|
||||
- golangci-lint run ./...
|
||||
|
||||
lint:playbooks:
|
||||
desc: "Lint playbook binding dirs for collisions (standalone tool, cmd/archie-playbooks)"
|
||||
summary: |
|
||||
Runs the standalone playbook linter (archie-playbooks lint) against
|
||||
./playbooks by default. It validates playbook YAML binding files
|
||||
against the same loaders the daemon uses at startup, so a pre-merge
|
||||
check can never disagree with runtime validation. Exit non-zero on
|
||||
any collision / malformed file / invalid binding.
|
||||
|
||||
Lint a different set of directories directly:
|
||||
go run ./cmd/archie-playbooks lint -dir ./a -dir ./b
|
||||
cmds:
|
||||
- go run ./cmd/archie-playbooks lint -dir ./playbooks
|
||||
|
||||
vuln:
|
||||
desc: "Scan for known stdlib/dependency CVEs (govulncheck). Not part of task check: it needs network access to the vuln DB and is not build/test-blocking; run it explicitly or in CI."
|
||||
cmds:
|
||||
|
||||
Reference in new issue
Block a user