feat(repocfg): Makefile target-help parser and verb/target drift linter #102

Closed
opened 2026-06-07 04:08:13 +00:00 by coilysiren · 1 comment
Owner

Extraction candidate from the coily cmd/coily/ generic-code audit (2026-06-06). Source pinned at coily commit c7c17cb (canonical: forgejo.coilysiren.me/coilyco-bridge/coily). cli-guard is mid-refactor, so the "suggested home" below is the pre-refactor package layout - land this in whatever the post-refactor equivalent is, not necessarily the named package. The durable principle: the classifiers / argv-transforms are generic and move; the policy decisions and message copy stay in coily.

Source: cmd/coily/lint.go - makeTargetHelp (regex), loadMakefileTargets; plus coily's hand-rolled coilyVerb/loadCoilyYamlVerbs. Already imports cli-guard/repocfg + exitcode.

What it does: cross-checks .coily/coily.yaml verbs against the repo Makefile - each verb's run must equal make <verb>, a matching ## desc target must exist, and descriptions must match. An order-preserving YAML+Makefile drift linter.

Generic core (lift this): the Makefile ## desc target-help parser (makeTargetHelp/loadMakefileTargets) is fully reusable.

Refactor required first (the file's own comment flags it): the drift check hand-parses coily's YAML instead of using the repocfg loader. A generalized linter should (a) consume repocfg for the verb list, and (b) lift the hardcoded make runner prefix to a parameter. Extract only after that refactor - otherwise you carry the hand-rolled parser upstream.

Consumer seams to parameterize: the expected runner prefix (make ); block-message branding.

Suggested home (pre-refactor): repocfg (or a small makelint helper beside it).

Done when:

  • generic logic lives in cli-guard with zero coily/Kai/Forgejo identifiers or defaults
  • behavior-covered tests (table tests where the source has them)
  • godoc-current.txt regenerated (scripts/check-godoc-current.sh --update)
  • coily migrated onto the extracted API, its local copy deleted, make test green both sides
  • closes this issue
> Extraction candidate from the coily `cmd/coily/` generic-code audit (2026-06-06). Source pinned at coily commit `c7c17cb` (canonical: `forgejo.coilysiren.me/coilyco-bridge/coily`). **cli-guard is mid-refactor**, so the "suggested home" below is the pre-refactor package layout - land this in whatever the post-refactor equivalent is, not necessarily the named package. The durable principle: **the classifiers / argv-transforms are generic and move; the policy decisions and message copy stay in coily.** **Source:** `cmd/coily/lint.go` - `makeTargetHelp` (regex), `loadMakefileTargets`; plus coily's hand-rolled `coilyVerb`/`loadCoilyYamlVerbs`. Already imports `cli-guard/repocfg` + `exitcode`. **What it does:** cross-checks `.coily/coily.yaml` verbs against the repo `Makefile` - each verb's `run` must equal `make <verb>`, a matching `## desc` target must exist, and descriptions must match. An order-preserving YAML+Makefile drift linter. **Generic core (lift this):** the Makefile `## desc` target-help parser (`makeTargetHelp`/`loadMakefileTargets`) is fully reusable. **Refactor required first (the file's own comment flags it):** the drift check hand-parses coily's YAML instead of using the `repocfg` loader. A generalized linter should (a) consume `repocfg` for the verb list, and (b) lift the hardcoded `make ` runner prefix to a parameter. Extract only after that refactor - otherwise you carry the hand-rolled parser upstream. **Consumer seams to parameterize:** the expected runner prefix (`make `); block-message branding. **Suggested home (pre-refactor):** `repocfg` (or a small `makelint` helper beside it). **Done when:** - [ ] generic logic lives in cli-guard with zero coily/Kai/Forgejo identifiers or defaults - [ ] behavior-covered tests (table tests where the source has them) - [ ] `godoc-current.txt` regenerated (`scripts/check-godoc-current.sh --update`) - [ ] coily migrated onto the extracted API, its local copy deleted, `make test` green both sides - [ ] `closes` this issue
Author
Owner

Backlog burndown 2026-06-17: closing low-priority (P3/P4) to bring the open count to a manageable level. Nothing lost — reopen if this resurfaces. Batch tag: burndown-2026-06.

Backlog burndown 2026-06-17: closing low-priority (P3/P4) to bring the open count to a manageable level. Nothing lost — reopen if this resurfaces. Batch tag: `burndown-2026-06`.
coilysiren 2026-06-17 08:23:20 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
coilyco-flight-deck/cli-guard#102
No description provided.