Skip to content

chore: lint markdown with markdownlint - #1108

Merged
viceice merged 1 commit into
mainfrom
viceice/markdownlint
Nov 27, 2026
Merged

viceice merged 1 commit into
mainfrom
viceice/markdownlint

Conversation

@viceice

@viceice viceice commented Nov 27, 2026

Copy link
Copy Markdown
Member

Changes

  • Lint markdown with markdownlint-cli2, with the config from containerbase/base.
  • Add lint:markdown to pnpm lint and the CI lint job, and fix staged markdown files in the commit hook.

Context

Please select one of the following:

  • This closes an existing Issue, Closes: Add lint #10
  • This doesn't close an Issue, but I accept the risk that this PR may be closed if maintainers disagree with its opening or implementation

AI assistance disclosure

Did you use AI tools to create any part of this pull request?

Please select one option and, if yes, briefly describe how AI was used (e.g., code, tests, docs) and which tool(s) you used.

  • No — I did not use AI for this contribution.
  • Yes — minimal assistance (e.g., IDE autocomplete, small code completions, grammar fixes).
  • Yes — substantive assistance (AI-generated non‑trivial portions of code, tests, or documentation).
  • Yes — other (please describe):

Use of AI in replying to PR comments

Who answers review comments:

  • @viceice will read and reply directly. Name the account.
  • An agent will draft replies and @username will read them before they are posted. Name the account.
  • An agent will draft replies and reply autonomously. This is heavily discouraged, and we prefer that there are humans in the loop
  • Nobody has explicitly committed to replying.

Documentation (please check one with an [x])

  • I have updated the documentation, or
  • No documentation update is required

How I've tested my work (please select one)

I have verified these changes via:

  • Code inspection only, or
  • Newly added/modified tests

Drafted by Claude Code (Claude Opus 5.5, low effort) on behalf of @viceice.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <michael.kriese+claude-code@mend.io>
@viceice
viceice enabled auto-merge November 27, 2026 11:25
@qodo-code-review

qodo-code-review Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

PR Summary by Qodo

Add Markdown linting to local and CI checks

✨ Enhancement ⚙️ Configuration changes 🕐 10-20 Minutes

Grey Divider

AI Description

• Add markdownlint-cli2 with repository-specific rules to catch Markdown issues consistently.
• Run Markdown checks in pnpm lint and CI; automatically fix staged Markdown before commits.
Merge Risk 🟢 Low

Blast radius 🟢 Low 💥 1 capability

  • 1 affected end-to-end capability after fault-specific containment; implementation boundaries do not widen its functional scope.
  • The changed workflow, package scripts, staged-file rules, configuration, and lockfile all implement one bounded repository-quality integration.
  • Their propagation ends at CI and local Markdown checks rather than separate user-facing capabilities.
Sources

package.json[8-10]

    "lint": "run-s oxfmt lint:markdown",
    "lint:markdown": "markdownlint-cli2 '**/*.md'",
    "lint-fix:markdown": "markdownlint-cli2 --fix '**/*.md'",

package.json[18-18]

    "markdownlint-cli2": "0.24.2",

.lintstagedrc.json[5-6]

  "*.md": ["markdownlint-cli2 --fix", "oxfmt --no-error-on-unmatched-pattern"],
  "!*.md": "oxfmt --no-error-on-unmatched-pattern"

pnpm-lock.yaml[194-196]

      markdownlint-cli2:
        specifier: 0.24.2
        version: 0.24.2
Behavioral complexity 🟢 Low 🧩 Straightforward

  • Before, CI and staged hooks ran the existing formatter without Markdown-specific validation.
  • After, they add a direct markdownlint invocation, a declarative rule set, and a locked development dependency.
  • The new correctness condition is that the executable, configuration syntax, and Markdown file patterns agree across package scripts, CI, and lint-staged; no new production algorithm, persistent state, concurrency protocol, or coordinated runtime invariant is introduced.
Sources

package.json[8-10]

    "lint": "run-s oxfmt lint:markdown",
    "lint:markdown": "markdownlint-cli2 '**/*.md'",
    "lint-fix:markdown": "markdownlint-cli2 --fix '**/*.md'",

.lintstagedrc.json[5-6]

  "*.md": ["markdownlint-cli2 --fix", "oxfmt --no-error-on-unmatched-pattern"],
  "!*.md": "oxfmt --no-error-on-unmatched-pattern"

pnpm-lock.yaml[194-196]

      markdownlint-cli2:
        specifier: 0.24.2
        version: 0.24.2
Potential damage 🟡 Medium 🩹 Temporary loss

  • If the new lint command or configuration fails, the CI lint job or local staged-file check can become unavailable or reject changes.
  • Because the build job needs lint, CI build progression can stop; no Ruby runtime or image contents are changed.
  • Reverting the scripts, workflow, configuration, and dependency restores the prior checks without persistent state repair or external compensation.
  • Code/configuration rollback restores the checking capability.
  • A failed CI run may need rerunning, while any developer-local formatting changes made before failure may need ordinary manual review.
Sources

package.json[8-10]

    "lint": "run-s oxfmt lint:markdown",
    "lint:markdown": "markdownlint-cli2 '**/*.md'",
    "lint-fix:markdown": "markdownlint-cli2 --fix '**/*.md'",

.lintstagedrc.json[5-6]

  "*.md": ["markdownlint-cli2 --fix", "oxfmt --no-error-on-unmatched-pattern"],
  "!*.md": "oxfmt --no-error-on-unmatched-pattern"
Assessed commit 617b784
Diagram

graph TD
  CI["CI lint job"] --> Scripts["pnpm scripts"] --> Linter["markdownlint-cli2"] --> Markdown["Markdown files"]
  Hook["Commit hook"] --> Staged["lint-staged"] --> Linter
  Config["Lint rules"] --> Linter
Loading
High-Level Assessment

Use markdownlint-cli2 alongside oxfmt: formatting alone does not provide Markdown lint rules. Sharing one configuration across CI, pnpm scripts, and staged-file fixes keeps the checks consistent.

Files changed (5) +754 / -2

Enhancement (1) +4 / -1
package.jsonExpose Markdown lint and fix commands +4/-1

Expose Markdown lint and fix commands

• Adds markdownlint-cli2 as a development dependency and provides lint and fix scripts. The aggregate lint command now includes the Markdown check.

package.json

Other (4) +750 / -1
build.ymlRun Markdown linting in CI +2/-0

Run Markdown linting in CI

• Adds a Markdown lint step to the existing lint job, so Markdown issues can block builds.

.github/workflows/build.yml

.lintstagedrc.jsonFix staged Markdown before formatting +2/-1

Fix staged Markdown before formatting

• Runs markdownlint-cli2 with --fix on staged Markdown, then formats it with oxfmt. Other staged files retain the oxfmt command.

.lintstagedrc.json

.markdownlint-cli2.jsoncDefine repository Markdown lint rules +30/-0

Define repository Markdown lint rules

• Adds Prettier-compatible Markdown rules with list-spacing and indentation settings, selected rule exceptions, and exclusions for ignored files and .claude.

.markdownlint-cli2.jsonc

pnpm-lock.yamlLock markdownlint-cli2 dependencies +716/-0

Lock markdownlint-cli2 dependencies

• Records markdownlint-cli2 0.24.2 and its transitive dependencies for reproducible installation.

pnpm-lock.yaml

@qodo-code-review

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Tip of the day
💡 Did you know, you can commit Qodo's fix in one click with committable suggestions (GitHub & GitLab)

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@viceice
viceice added this pull request to the merge queue Nov 27, 2026
Merged via the queue into main with commit 3d401c5 Nov 27, 2026
7 checks passed
@viceice
viceice deleted the viceice/markdownlint branch November 27, 2026 11:41
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.

Add lint

1 participant