Skip to content

fix: make lint:markdown a read-only gate + codify the standard#44

Merged
evanharmon1 merged 2 commits into
mainfrom
refactor/lint-markdown-check-only
Jun 28, 2026
Merged

fix: make lint:markdown a read-only gate + codify the standard#44
evanharmon1 merged 2 commits into
mainfrom
refactor/lint-markdown-check-only

Conversation

@evanharmon1

@evanharmon1 evanharmon1 commented Jun 28, 2026

Copy link
Copy Markdown
Owner

Syncs harmon-init (#151). Two commits: fix the repo's task, then codify the standard in the skill.

1. lint:markdown → read-only gate (drop --fix)

It ran markdownlint-cli2 **--fix** — the only lint:* task that mutates files. In CI that discards the fix while reporting green; in the pre-commit hook (no stage_fixed) it commits the unfixed staged blob and leaves a dirty tree. Drop --fix so it reports + fails like lint:prettier/lint:shell. Auto-fix stays in task format / format:file / fix. Forward-compatible with copier update.

2. Codify it in the standards-catalog (makes audit enforce it)

  • Added a "Lint vs. format discipline (read-only gates)" standard to the Taskfile section: every lint:*/check/verify is read-only; auto-fix only in format/format:file/fix; no lint:* runs --fix/--write/-w/-i; the markdown hook has no stage_fixed. Names the classic regression to flag.
  • Corrected a stale entry — the catalog's lint:markdown command body still documented the old --fix form.

Verified

  • task verify → exit 0; lint:markdown over 74 Markdown files (catalog in scope) → 0 errors.

🤖 Generated with Claude Code

evanharmon1 and others added 2 commits June 28, 2026 13:25
Sync the harmon-init lint:markdown fix (harmon-init#151). It ran
`markdownlint-cli2 --fix` -- the only lint:* task that mutated files:

- In CI, --fix repairs the ephemeral checkout, the task exits 0, and the fix is
  discarded with the runner -- green while the branch stays unformatted.
- In the pre-commit hook (`task lint:markdown -- {staged_files}`, no
  stage_fixed), --fix edits the working tree but the commit captures the unfixed
  staged blob -- commits the broken version and leaves a dirty tree.

Drop --fix so it reports + fails like lint:prettier (--check) / lint:shell
(shfmt -d). Auto-fix is unchanged (`task format` / `task format:file` / `fix`).
Matches the template's new form, so a future `copier update` 3-way merges clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Make the lint-vs-format discipline auditable so `audit` mode flags regressions:
add a "Lint vs. format discipline (read-only gates)" standard to the Taskfile
section — every lint:* and check/verify is read-only, all auto-fix lives in
format/format:file/fix, no lint:* body runs --fix/--write/-w/-i, and the
markdown hook has no stage_fixed. Names the classic regression to flag
(lint:markdown carrying markdownlint-cli2 --fix).

Also corrects the stale `lint:markdown` command body in the catalog, which still
documented the old `--fix` form (now check-only, matching the template).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@evanharmon1 evanharmon1 changed the title fix: make lint:markdown a read-only gate (drop --fix) fix: make lint:markdown a read-only gate + codify the standard Jun 28, 2026
@evanharmon1 evanharmon1 merged commit 63b8784 into main Jun 28, 2026
4 of 5 checks passed
@evanharmon1 evanharmon1 deleted the refactor/lint-markdown-check-only branch June 28, 2026 18:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant