ci(docs): add markdownlint foundation (prek + CI)#11210
Conversation
|
Please add an entry to the corresponding |
|
✅ Conflict Markers Resolved All conflict markers have been successfully resolved in this pull request. |
🔒 Container Security ScanImage: 📊 Vulnerability Summary
2 package(s) affected
|
🔒 Container Security ScanImage: 📊 Vulnerability Summary
2 package(s) affected
|
4ca5a9a to
494a7aa
Compare
🔒 Container Security ScanImage: 📊 Vulnerability Summary
4 package(s) affected
|
Add markdownlint to the project to enable consistent Markdown formatting across ~112 markdown files. This is the foundation; auto-fixable issues will be addressed in a follow-up PR. - .markdownlint.json: extends markdownlint/style/prettier with line-length and no-bare-urls disabled (conservative defaults) - .markdownlintignore: excludes node_modules/, .venv/, build outputs, contrib/ - .pre-commit-config.yaml: add igorshubovych/markdownlint-cli hook (priority 30) - Makefile: add lint-markdown and format-markdown targets Refs: WebstormProjects-qua Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Add a GitHub Actions workflow that runs the same markdownlint-cli v0.45.0 pinned in .pre-commit-config.yaml, so prek and CI behave identically. The workflow uses tj-actions/changed-files to lint only .md files in the PR (matching the sdk/api-code-quality pattern), which lets existing violations be cleaned up incrementally without blocking unrelated work. - .github/workflows/markdown-lint.yml: harden-runner + changed-files + npm install markdownlint-cli@0.45.0 + lint changed files only. - .markdownlintignore: ignore **/CHANGELOG.md — auto-generated by the prowler-changelog skill (keepachangelog format legitimately repeats "### Fixed"/"### Added" across versions); revisit with the team. - Apply markdownlint --fix across the repo (whitespace, list markers, trailing punctuation, blanks around tables) — 17 files affected. - Promote bold-as-heading callouts to real headings in README.md and CONTRIBUTING.md so MD036/MD025 stop firing on touched files. - Add alt text to README badges (MD045) and replace the "[here]" link text with descriptive copy (MD059). - Tag fenced code blocks with the `text` language in skills/ and ui/docs/code-review docs (MD040). Refs: WebstormProjects-qua Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Switch CI to lint **/*.md instead of the changed-file subset, aligning with the api/sdk code-quality gating pattern (gate via changed-files, lint the full scope). - Replace `npm install --global` with `pnpm dlx --ignore-scripts` and pin Node via ui/.nvmrc for consistency with the UI workspace. - Fix the violations surfaced by the wider scope: MD040 fenced-code language across skills/ and project READMEs; MD036 emphasis-as- heading in tdd/docs/mcp_server; MD025 multi-h1 cascade in api/README.md; MD001 increment in *AGENTS.md; MD024 duplicate heading in skill-creator/SKILL.md. Formatting-only — no copy or code changes.
Lint-all is fast (~5s on the tree) and the full job (~30s) saves so little when skipped that the gate doesn't pay for itself the way it does in api-/sdk-code-quality (where Python toolchain setup costs 60-90s). Removing the gate also drops a third-party action with a documented 2025 supply-chain incident (still pinned by SHA here, but fewer external dependencies is a win when the cost is this small).
Node 24.13.0 (pinned via ui/.nvmrc) is not in the runner toolcache, so actions/setup-node fetches it from the actions/node-versions release assets at release-assets.githubusercontent.com — which harden-runner was blocking. Mirrors the allowlist used by ui-tests.yml, which hits the same path.
`pnpm dlx --ignore-scripts ...` errors with "Unknown option: 'ignore- scripts'" — pnpm only honors the flag on `pnpm install`. Set the same behavior via the `pnpm_config_ignore_scripts=true` env var, which pnpm reads at runtime. Preserves the postinstall-blocking guarantee against malicious transitives without changing the command name.
494a7aa to
ef923b8
Compare
Context
The repo had no consistent markdown lint enforcement. Style drifted between docs and was caught only during review, with the same fixes repeated PR after PR. This change wires
markdownlintinto both prek (local pre-commit) and CI so violations are caught up front, and cleans up the pre-existing violations the repo-wide scope surfaces so CI stays green from day one.Description
Wires a shared markdown lint pipeline (prek + CI) and applies a one-shot, formatting-only cleanup of the violations the repo-wide scope exposes.
What's wired
.markdownlint.json(rule config) and.markdownlintignore(path scope).markdownlint-cli@0.45.0in.pre-commit-config.yaml(prek hook — runs locally on touched*.md)..github/workflows/markdown-lint.yml(Docs: Markdown Lint): triggers on PRs/pushes tomaster/v5.*and lints the whole tree with the same pin. Notj-actions/changed-filesgate — the lint itself is ~5s, so the gate doesn't pay for itself the way it does in Python toolchains, and skipping the third-party action removes a small supply-chain surface. Node sourced fromui/.nvmrc. Invocation usespnpm dlx --ignore-scriptsto mitigate postinstall risk on transitive deps.Rule overview
The config extends
markdownlint/style/prettier(which already disables anything Prettier would reformat — line length, list indent, fence/blank spacing, etc.). On top of that:MD024no-duplicate-headingsiblings_only: true### Argsblocks).MD033no-inline-html<details>, callouts, badges, etc.MD034no-bare-urlsMD041first-line-h1The high-impact rules left enabled (the ones that actually fired across the repo and drove the cleanup commit):
fenced-code-language— fenced code blocks must declare a language.no-emphasis-as-heading—**Section title**on its own line must be a real heading.heading-increment— heading levels increment by one (no##→####).single-h1— one top-level# H1per document.no-duplicate-heading(siblings-only).Path scope
**/*.mdrepo-wide, minusnode_modules,.git,.venv,dist,build,htmlcov,.next,ui/out,contrib/, and**/CHANGELOG.md(keepachangelog format legitimately repeats### Added/Changed/Fixedand would tripMD024).Cleanups
ui/tests/*.md, the touchedskills/*.md) — formatting only.skills/**and project READMEs; MD036 intdd/SKILL.md,docs/AGENTS.md,mcp_server/README.md; MD025 cascade inapi/README.md; MD001 in*AGENTS.md; MD024 dup inskill-creator/SKILL.md. Formatting and outline only — no copy, no code samples, no links changed.Steps to review
.markdownlint.json— anything you want disabled, tightened, or scoped differently?.markdownlintignore— same question for path scope (vendored/build trees, CHANGELOGs, anything else you'd add)..github/workflows/markdown-lint.ymland themarkdownlint-clientry in.pre-commit-config.yaml. Versions are pinned and kept in sync between the two.skills/**,*/AGENTS.md, or*/README.md— skim the diff for your file as a sanity check on the mechanical edits (code-fence languages, promoted headings, re-leveling). No copy, code, or links were changed.pnpm dlx --ignore-scripts markdownlint-cli@0.45.0 '**/*.md'— should exit 0.Checklist
Community Checklist
*.md.SDK/CLI
UI
API
License
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.