Skip to content

test: add a shared prose check and CI10 for it - #134

Closed
lesnik512 wants to merge 1 commit into
mainfrom
prose-check
Closed

lesnik512 wants to merge 1 commit into
mainfrom
prose-check

Conversation

@lesnik512

Copy link
Copy Markdown
Member

Adds tests/test_prose.py, a shared check that repos fetch from main and run with just prose-check, the same way just adr-check runs tests/test_adr_citations.py (CI9). The standard gets a new CI10 for it, as a SHOULD, with the recipe byte for byte.

The check fails on:

  • an em dash (U+2014) or en dash (U+2013) in the root README.md (or readme.md), CONTEXT.md and AGENTS.md, and in any .md under docs/ except docs/agents/
  • emoji in a heading of the root README

It skips fenced code (backtick or tilde, indented or not), inline code, a table cell that holds only a dash, and an en dash between two digits.

Decisions

  • Numeric ranges: an en dash with a digit directly on each side (3–5, 3.11–3.14) passes. A spaced en dash (3 – 5) is reported, and so is an em dash between digits (3—5). The en dash is the usual range mark, and requiring digits on both sides with no spaces keeps it from letting a pause through.
  • Emoji are matched by Unicode block (pictographs, emoticons, dingbats, misc symbols, a few technical symbols, and the U+FE0F presentation selector). There is no dependency, because the file runs with only pytest installed. GitHub :shortcode: emoji are not matched.
  • Only # headings are checked. Setext headings and HTML <h1> tags are not.
  • The emoji rule covers the README only, since that is what RM3 is about. Emoji in docs pages pass.

Also in this PR

  • docs/DEPLOYMENT.md had an em dash. This repo runs the check on itself through uv run pytest, so it is fixed here.
  • The canonical AGENTS.md paragraph in Appendix B had an em dash at the end of its first line. FL2 requires that paragraph word for word, so the check would fail every repo that follows it exactly. It now has a colon, which 25 repos already use.

Current violations (not fixed here)

I ran the check against origin/main of every repo checkout under modern-python (31 repos, this one included). No README has an emoji heading. 28 repos are clean.

  • release-scope: AGENTS.md:13, the old Appendix B em dash.
  • .github: docs/DEPLOYMENT.md:41, fixed in this PR.
  • modern-di: 51 em dashes, mostly in the link lists at the bottom of docs pages.
modern-di, by file and line
AGENTS.md: 27, 29, 48, 50, 56
docs/introduction/performance.md: 139, 140, 141, 142
docs/providers/advanced-api.md: 73, 74, 76
docs/providers/alias.md: 153, 154, 156, 158
docs/providers/container.md: 163, 165, 166
docs/providers/context.md: 310, 311, 312, 314, 316
docs/troubleshooting/async-finalizer-in-sync-close-error.md: 73, 74
docs/troubleshooting/container-closed-error.md: 84, 86
docs/troubleshooting/finalizer-error.md: 94, 96
docs/troubleshooting/invalid-child-scope-error.md: 75, 77
docs/troubleshooting/invalid-scope-type-error.md: 51
docs/troubleshooting/max-scope-reached-error.md: 74, 76
docs/troubleshooting/scope-chain.md: 117, 120, 121
docs/troubleshooting/scope-enum-mismatch-error.md: 84, 86
docs/troubleshooting/scope-not-initialized-error.md: 80, 81, 84
docs/troubleshooting/scope-skipped-error.md: 110, 112
docs/troubleshooting/validation-failed-error.md: 36, 37, 38, 40, 42, 94

Rollout

CI10 is a SHOULD. A repo adds just prose-check to its lint job once it passes, so modern-di and release-scope need a fix first. This PR does not set a date for it to become a MUST.

Test plan

  • uv run pytest: 187 passed
  • uv run mkdocs build --strict: passes
  • Ran the CI10 recipe end to end with prose_check_source pointed at the file:// copy, on copies of release-scope (fails on AGENTS.md:13) and faststream-redis-timers (passes). The temporary directory is removed afterwards.

tests/test_prose.py fails on an em or en dash in prose Markdown and on
emoji in a README heading. Repos fetch it from main with just prose-check,
the way CI9 runs the ADR check. Appendix B and DEPLOYMENT.md lose their
em dashes so this repo passes its own check.
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