Skip to content

fix(template): markdownlint — exclude artifact dirs + MD024 siblings_only#84

Merged
evanharmon1 merged 2 commits into
mainfrom
fix/lint-markdown-exclude-artifact-dirs
Jun 23, 2026
Merged

fix(template): markdownlint — exclude artifact dirs + MD024 siblings_only#84
evanharmon1 merged 2 commits into
mainfrom
fix/lint-markdown-exclude-artifact-dirs

Conversation

@evanharmon1

@evanharmon1 evanharmon1 commented Jun 23, 2026

Copy link
Copy Markdown
Owner

Summary

Two markdownlint config fixes for generated repos, both surfaced while applying
the template to an existing Terraform repo (sommerlawn/sommerlawn-infra).

1. Exclude gitignored artifact/cache dirs from lint:markdown

The lint:markdown task globbed '**/*.md' excluding only
.claude/node_modules/dist/.worktrees. markdownlint-cli2 does not read
.gitignore, so a rendered iac repo's gitignored provider caches
(terraform/**/.terraform/, full of markdown CHANGELOGs) and the uv-managed
.venv/ flooded task verify with errors — none of it tracked.

- npx --yes markdownlint-cli2 --fix '**/*.md' '#.claude/**' '#**/node_modules/**' '#dist/**' '#.worktrees/**'
+ npx --yes markdownlint-cli2 --fix '**/*.md' '#.claude/**' '#**/node_modules/**' '#dist/**' '#.worktrees/**' '#**/.terraform/**' '#**/.venv/**' '#**/.task/**'

Chosen over .markdownlint-cli2.jsonc ignores because that file only ships when
use_release_please — the task glob covers every answer profile. The CLI_ARGS
(lefthook staged-files) path is unaffected; gitignored files are never staged.

2. MD024: { siblings_only: true } in .markdownlint.json

Default MD024 (no-duplicate-heading) flags any repeated heading text in a file,
tripping legitimate doc patterns like a per-host #### Purpose / #### Access
subsection in an inventory/runbook doc. siblings_only flags duplicates only when
they share a parent heading — genuine same-level anchor collisions (two ## Setup)
still error.

Test plan

  • task test:template:all passes (all 5 profiles) after both changes. ✅
  • Migrate copier #1 behavioral check: rendered the iac profile, planted markdownlint-violating
    files under terraform/**/.terraform/ and .venv/, ran the rendered repo's
    task lint:markdown → 38 files, 0 errors. ✅
  • Update taskfile #2 behavioral check: rendered repo — repeated ### Purpose/### Access under
    different ## parents → 0 errors; two ## Setup siblings → still 1 MD024 error. ✅

Context

Companion to evanharmon1/harmon-devkit#22, which fixes the same .gitignore-blind
false-positive in the standardize-repo skill's verify-applied.sh.

🤖 Generated with Claude Code

The generated lint:markdown task globbed '**/*.md' excluding only
.claude/node_modules/dist/.worktrees, so a rendered iac repo's
gitignored provider caches (terraform/**/.terraform/, full of markdown
CHANGELOGs) and the uv-managed .venv/ flooded `task verify` with
markdownlint errors — none of it tracked. markdownlint-cli2 does not
read .gitignore, so it must be told explicitly.

Add '#**/.terraform/**', '#**/.venv/**', and '#**/.task/**' to the
default glob, matching the existing '#'-exclusion style. The CLI_ARGS
(lefthook staged-files) path is unaffected — gitignored files are never
staged. Verified by rendering the iac profile, planting violating
markdown under .terraform/ and .venv/, and confirming the rendered
`task lint:markdown` reports 0 errors.

Surfaced applying the template to an existing Terraform repo
(sommerlawn-infra), which needed the same ignores added by hand.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Default MD024 (no-duplicate-heading) flags any repeated heading text in a
file, which trips legitimate doc patterns — e.g. a per-host/per-service
"Purpose"/"Access" subsection (one per ### host) in an inventory or runbook
doc. Set siblings_only so duplicates are flagged only when they share a
parent heading; real same-level anchor collisions (two ## Setup) still error.

Verified: a rendered repo passes on cross-parent repeats and still errors on
genuine sibling duplicates; task test:template:all passes.

Surfaced applying the template to sommerlawn-infra (docs/architecture/hosts.md).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@evanharmon1 evanharmon1 changed the title fix(template): exclude artifact/cache dirs from lint:markdown fix(template): markdownlint — exclude artifact dirs + MD024 siblings_only Jun 23, 2026
@evanharmon1 evanharmon1 merged commit 7c7ae07 into main Jun 23, 2026
9 checks passed
@evanharmon1 evanharmon1 deleted the fix/lint-markdown-exclude-artifact-dirs branch June 23, 2026 19:18
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