Skip to content

ci: guard docstrings against typography that breaks docs generation#142

Merged
NavarrePratt merged 2 commits into
mainfrom
npratt/docstring-hygiene
Jul 2, 2026
Merged

ci: guard docstrings against typography that breaks docs generation#142
NavarrePratt merged 2 commits into
mainfrom
npratt/docstring-hygiene

Conversation

@NavarrePratt

Copy link
Copy Markdown
Collaborator

Why

This package's public docstrings are the source for an auto-generated API reference. The documentation build rejects certain typographic characters - em dashes, en dashes, smart quotes, and ellipsis - which otherwise pass straight through into the rendered output and fail the build.

What

  • Removes em dashes from the affected docstrings (rewritten with hyphens or colons; the CLI title lines use a spaced hyphen). No logic changes.
  • Adds an AST-based docstring hygiene guard (scripts/check_docstring_hygiene.py) wired into a new CI workflow and into mise run check, so future changes stay clean. The guard inspects docstrings only - including PEP 257 attribute docstrings - and skips the generated _proto/ stubs.

Scope notes

  • The guard is docstring-scoped: comment em dashes and non-docstring string literals are intentionally not enforced. Only docstrings feed the API reference.
  • en dashes, smart quotes, and ellipsis are also banned (none exist today) since the same documentation build rejects them.

The public docstrings are the source for an auto-generated API reference
whose build rejects em dashes. Replace them with hyphens or colons. Scope
is docstrings only; comment em dashes are left unchanged.
Add an AST-based guard that flags em dashes, en dashes, smart quotes, and
ellipsis in docstrings under src/ (including PEP 257 attribute docstrings),
skipping the generated _proto stubs. Wire it into a new PR workflow and the
mise check aggregate so future docstrings stay clean.
@NavarrePratt NavarrePratt merged commit 2122263 into main Jul 2, 2026
6 checks passed
@NavarrePratt NavarrePratt deleted the npratt/docstring-hygiene branch July 2, 2026 13:09
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.

2 participants