Skip to content

ci: introduce markdownlint-cli2 and verify docs build on PRs#718

Merged
laughingman7743 merged 3 commits into
masterfrom
ci/markdownlint-cli2
May 24, 2026
Merged

ci: introduce markdownlint-cli2 and verify docs build on PRs#718
laughingman7743 merged 3 commits into
masterfrom
ci/markdownlint-cli2

Conversation

@laughingman7743
Copy link
Copy Markdown
Member

WHAT

Closes #717.

  • Add .markdownlint-cli2.jsonc tuned to PyAthena's existing Markdown style (dash bullets, 2-space nested indent, allow inline HTML used by README centered-image markup and MyST admonitions).
  • Pin markdownlint-cli2@0.18.1 via .mise.toml using mise's npm: backend. No node declaration needed — mise resolves it automatically.
  • Add .github/workflows/docs-lint.yaml that runs on PRs touching docs/**, **.md, .markdownlint-cli2.jsonc, .mise.toml, Makefile, or the workflow itself. Two jobs:
    • lintmake docs/lint (markdownlint-cli2)
    • buildmake docs/build (sphinx-multiversion)
  • Namespace make targets with /:
    • docsdocs/build; added docs/lint, docs/format
    • testtest/pyathena; test-sqlatest/sqla; test-sqla-asynctest/sqla-async
    • Tox config (pyproject.toml) and existing CI workflows updated to match.
  • Fix all existing Markdown lint violations (auto-fix + 5 manual: MD051 MyST {ref}, three MD036 heading promotions in pandas.md, MD001 "Basic usage" wrapper in sqlalchemy.md, 4 bare README footer URLs wrapped in <...>).
  • Enable rules that auto-fix or have small violation counts: MD031, MD032, MD034, MD040.
  • Document the local workflow in CLAUDE.md.

Intentionally kept disabled with rationale in .markdownlint-cli2.jsonc:

  • MD013 (line length) — docs have long URLs and code lines
  • MD014 ($ without output) — intentional in docs/testing.md and README shell snippets
  • MD024 siblings_only: true — cursor docs reuse subsection names
  • MD041 (first line H1) — MyST (label)= ref targets precede the first heading

WHY

The docs Sphinx build currently runs only on push to master (.github/workflows/docs.yaml). Syntax errors, broken cross-references, or other build failures are only caught after merge. Markdown style also drifts across files (*/- bullets mixed, missing blanks around fences, etc.).

This PR catches both classes of failure on the PR itself, and aligns existing files with one consistent style without changing rendered output.

laughingman7743 and others added 3 commits May 24, 2026 14:06
…717)

Lint Markdown under docs/ and project-root *.md, and run sphinx-multiversion
build on docs-touching PRs to catch syntax/reference errors before merge.

- Pin markdownlint-cli2 0.18.1 via .mise.toml (npm backend; node auto-resolved)
- Add .markdownlint-cli2.jsonc tuned to existing PyAthena docs style:
  dash bullets, 2-space indent, allow inline HTML used in MyST/README
- Add make docs-lint / docs-lint-fix targets that shell out via mise exec
- Add .github/workflows/docs-lint.yaml: lint + sphinx-multiversion build,
  triggered only on docs/**, **.md, and the workflow/config files themselves
- Fix 5 remaining manual violations after auto-fix:
  - MD051: use MyST {ref}`pandas-cursor` instead of broken HTML anchor
  - MD036: promote three bold-as-heading spans in pandas.md to h4
  - MD001: add "Basic usage" h2 wrapper in sqlalchemy.md
- Auto-fix touched README.md, CLAUDE.md, docs/*.md (mostly bullet style)
- Document mise-based local workflow in CLAUDE.md

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Originally disabled to land the initial config without manual cleanup, but
the violations are all fixable and the rules catch real Markdown smell.

- MD040 (require code fence language): 0 violations after auto-fix
- MD031 (blanks around fences) / MD032 (blanks around lists): fixed by
  --fix in docs/introduction.md, docs/sqlalchemy.md, CLAUDE.md
- MD034 (no bare URLs): wrapped 4 footer URLs in README.md with <...>

Remaining intentionally-disabled rules:
- MD013 (line length): docs have long URLs and code lines
- MD014 ($ command without output): convention in docs/testing.md, README
- MD024 siblings_only: cursor docs reuse subsection names per cursor
- MD041 (first line H1): MyST `(label)=` ref targets precede the first heading

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Group related targets under a common namespace for discoverability:

- docs           -> docs/build
- (new)          -> docs/lint
- (new)          -> docs/format
- test           -> test/pyathena
- test-sqla      -> test/sqla
- test-sqla-async-> test/sqla-async

Propagate the rename through pyproject.toml (tox commands), CLAUDE.md,
docs/testing.md, and the docs/docs-lint GitHub workflows.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@laughingman7743 laughingman7743 marked this pull request as ready for review May 24, 2026 05:40
@laughingman7743 laughingman7743 merged commit f41404c into master May 24, 2026
18 checks passed
@laughingman7743 laughingman7743 deleted the ci/markdownlint-cli2 branch May 24, 2026 05:40
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.

Introduce markdownlint-cli2 and verify docs build on PRs

1 participant