Repository navigation
chore: add markdown linting to pre-commit hooks and CI - #223
Merged
Merged
Conversation
Adds markdownlint-cli2 (structure rules + custom unicode ban) and html-validate (validates html code fences inside markdown) as pre-commit hooks and a markdown-lint CI job, following the existing pattern of local hooks re-run standalone with identical pins in CI. - .markdownlint-cli2.jsonc: scope source of truth (globs/ignores exclude machine-generated trees: .ralph, plans, tests, site, target, .tablassert); MD013/MD033/MD046 off with rationale, MD024 siblings_only, MD060 compact - .markdownlint/no-unicode-chars.cjs: custom auto-fixable rule banning em/en dashes, unicode arrows, and unicode bullets (ASCII replacements) - .htmlvalidate.json: recommended preset + html-validate-markdown transform (fence-scoped: the built-in markdown transformer false-positives on '<' inside inline code spans, e.g. (?<=..., <name>_<version>) - .pre-commit-config.yaml: markdownlint-cli2 v0.23.3 mirror hook (--fix) and local node html-validate hook; pins cross-referenced with CI - .github/workflows/ci.yml: markdown-lint job, pinned npx commands - bulk: one-time --fix remediation (table pipe padding, blank lines around headings/lists, code fence languages) plus manual fixes: MD036 emphasis promoted to real headings (docs/index.md, docs/configuration/table.md), preserved the semantically-significant trailing space in docs/configuration/advanced-example.md Verified: markdownlint 0 issues across 24 files, html-validate clean, pre-commit hooks pass, mkdocs build --strict green, tests/test_docs_style.py 4/4, tests/ and plans/ untouched.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds markdown linting as solid gates at both levels, following the repo's existing pattern (fast auto-fixing pre-commit hooks; CI re-runs the same tools with identical pins so local and CI cannot drift).
.markdownlint-cli2.jsonc(globs/ignores exclude machine-generated trees:.ralph/,plans/,PLAN.md,tests/,site/,target/,.tablassert/).markdownlint/no-unicode-chars.cjs) — bans em/en dashes, unicode arrows (→ ⇒ ⟶ ➜ ➔ ⇨ ←) and unicode bullets (• ‣ ◦), auto-fixed to ASCII (-,->,<-)html-validate-markdown6.0.0 — validates```htmlcode fences inside markdownmarkdownlint-cli2mirror hook (--fix, pre-commit stage) + local nodehtml-validatehookmarkdown-lintjob inci.yml, standalone likepython-lint(node is preinstalled on runners), pins cross-referenced with the pre-commit configdocs/configuration/advanced-example.md)Rule decisions
tests/test_docs_style.pybans HTML comments, so inline disables are impossiblesiblings_only### Addedper releasecompactHTML linting design note
html-validate's built-in markdown transformer does not escape
<inside inline code spans — prose like`(?<=...)`or`<name>_<version>`(this repo's placeholder convention) parses as start tags with non-suppressibleparser-error(rule config,--rule, and disable comments all verified ineffective). The third-partyhtml-validate-markdowntransformer is fence-scoped instead: zero false positives, and real HTML blocks are still gated.Verification
npx markdownlint-cli2@0.23.3→ 0 issues in 24 files (exact CI command)npx -y -p html-validate@11.16.4 -p html-validate-markdown@6.0.0 html-validate "**/*.md"→ clean (exact CI command)pre-commit run markdownlint-cli2 --all-files/html-validate --all-files→ passuv run --no-sync mkdocs build --strict→ greentests/test_docs_style.py→ 4/4 (custom rule documented against its prose-arrow ban)<span>in a```htmlfence failed both tools;--fixrewrote the unicodetests/andplans/untouched