Skip to content

test(standards): fail when markdownlint.json drifts from dotfiles - #202

Merged
twistedmelonman merged 1 commit into
mainfrom
claude/test-markdownlint-drift
Oct 22, 2026
Merged

twistedmelonman merged 1 commit into
mainfrom
claude/test-markdownlint-drift

Conversation

@twistedmelonman

Copy link
Copy Markdown
Member

What

tests/test-markdownlint-drift.sh fails when standards/markdownlint.json differs from dotfiles' canonical markdownlint-cli/.markdownlint.json on main. It compares with jq -S.

  • Source of the dotfiles copy: raw.githubusercontent.com (dotfiles is public), or MARKDOWNLINT_DOTFILES_CONFIG when set.
  • If neither can be read, or either file does not parse, the test fails. It never skips.
  • A built-in control flips MD013 in a temp copy and checks that the comparison catches it.

CI

Nothing in this repo's CI ran tests/ before; only standards-check and the checkout guardrail did. This PR adds a markdownlint-drift job to self-review.yml that runs only this file. It needs only curl and jq, which ubuntu-latest has. It is not a required check, and this PR does not change branch protection. tests/run-tests.sh also picks the file up locally.

The checkout guardrail in the same workflow scans only the two dependabot-auto-merge workflows, and self-review.yml triggers on pull_request, so the new job's actions/checkout step does not touch that guardrail.

Known-bad runs (local)

  • dotfiles copy with MD033 flipped: FAIL, with a diff.
  • Fetch blocked (proxy at 127.0.0.1:9): FAIL, "cannot fetch".
  • MARKDOWNLINT_DOTFILES_CONFIG names a missing file: FAIL.
  • Unparseable JSON: FAIL, "could not parse".
  • Real copies: 2 ok.

The mirror test lands in smartwatermelon/dotfiles (bash/tests/test-markdownlint-config-drift.sh).

standards/markdownlint.json and dotfiles' canonical
markdownlint-cli/.markdownlint.json are kept in step by hand, and
nothing checked them. The commit gate lints with the dotfiles copy
and standards-check with this one, so drift means local and CI
disagree.

tests/test-markdownlint-drift.sh compares the two with jq -S. It
fetches the dotfiles copy from raw.githubusercontent.com (main), or
reads MARKDOWNLINT_DOTFILES_CONFIG. If it cannot read either, it
fails rather than skips. A built-in control proves a flipped rule
is caught.

tests/ has no CI job here, so self-review.yml gains a
markdownlint-drift job that runs only this file (curl and jq ship on
the runner). It is not a required check.

dotfiles carries the mirror test.
@twistedmelonman
twistedmelonman merged commit 2cc748c into main Oct 22, 2026
6 checks passed
@twistedmelonman
twistedmelonman deleted the claude/test-markdownlint-drift branch October 22, 2026 04:45
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