Skip to content

Add an optional en-GB-oxendict spelling gate (default on)#27

Open
leynos wants to merge 1 commit into
mainfrom
add-en-gb-oxendict-gate
Open

Add an optional en-GB-oxendict spelling gate (default on)#27
leynos wants to merge 1 commit into
mainfrom
add-en-gb-oxendict-gate

Conversation

@leynos

@leynos leynos commented Jul 7, 2026

Copy link
Copy Markdown
Owner

Summary

Generated repositories now enforce en-GB Oxford ("-ize") spelling in documentation via a typos gate, mechanizing the mandate the generated documentation style guide already carries. The feature is a copier option, default enabled.

Provenance

  • Mechanism: stilyagi commit ee77d08a19bc9c1107f30fc2b5bb63ced979fbc4 — the two-layer typos.toml design (the en-gb locale corrects American spellings; generated extend-words entries restore Oxford -ize), the TYPOS_VERSION single source of truth, and the uv tool run typos@$(TYPOS_VERSION) join onto the markdownlint gate.
  • Generator and tests: taken from the leynos/netsuke import (PR Enforce en-GB-oxendict spelling with typos netsuke#407, enforce-oxendict-spelling), which carries the fix for stilyagi issue #57 — parse-based tests: tomllib.loads() of render_config() asserting the exact extend-words count (len(EXTRA_ACCEPTED_WORDS) + 2*len(STEMS)*len(SUFFIX_PAIRS)), so duplicate keys fail fast at generation time, plus a parse of the committed typos.toml.

Toggle semantics

New copier boolean en_gb_oxendict (default true). Everything is gated with the template's own conditional mechanisms — conditional filenames for whole files ({% if en_gb_oxendict %}scripts{% endif %}/generate_typos_config.py, {% if en_gb_oxendict %}typos.toml{% endif %}, the test module) and in-file blocks for the Makefile, CI, pyproject, AGENTS.md, and developers'-guide fragments. Toggle-off renders contain no trace (verified: zero typos mentions), and the toggle composes with use_rust (all four combinations render clean).

What generated repositories get

  • scripts/generate_typos_config.py — netsuke's generator, minimally adapted: generic accepted-words list (netsuke-specific entries dropped), requires-python >= 3.10 to match the template floor, and an extend-ignore-re entry for a verbatim citation title in the generated docs.
  • typos.toml — committed artefact generated by running the templated generator (1,766 extend-words entries; drift-checked by the test suite).
  • tests/test_generate_typos_config.py — rides the generated pytest suite (testpaths = ["tests"]), including the #57 parse tests and the committed-file drift check. Uses tomllib with a tomli dev-group fallback (tomli; python_version < '3.11') so pre-3.11 baselines typecheck and run.
  • Makefile: TYPOS_VERSION ?= 1.48.0 single source of truth; make markdownlint runs markdownlint then find … | xargs -0 env $(UV_ENV) uv tool run typos@$(TYPOS_VERSION) --config typos.toml --force-exclude (stilyagi's MD_FILES_FIND pattern, with the Rust target directory excluded for use_rust variants).
  • CI: the generated ci.yml did not previously run the docs-lint target, so a Lint documentation step calling make markdownlint is wired in (gated on the toggle).
  • Docs: AGENTS.md Markdown-guidance bullets and a developers'-guide "Spelling gate" section (stilyagi's wording, shortened): two-layer design, regeneration command, where to add stems/accepted words, backticks-not-exceptions for quoted APIs.

Spelling and lint fixes surfaced by the gate

Wiring make markdownlint into CI surfaced pre-existing failures in rendered output, now fixed: MD012 blank-line residue from untrimmed Jinja blocks in AGENTS.md.jinja and README.md.jinja, and an MD013 over-length line in the developers' guide. Running typos over rendered docs flagged twelve genuine errors, corrected in template prose: afterwardafterwards, summarisesummarize, parameterisationparameterization (AGENTS.md); artifact(s)artefact(s) ×3 (developers' guide); signalingsignalling (complexity guide — the same fix stilyagi made); serialisationserialization, standardisedstandardized, emphasisesemphasizes, parameterisedparameterized (.rules/). One verbatim citation title ("… Azure Architecture Center | Microsoft Learn") is carried by an extend-ignore-re entry rather than a prose change.

Validation

  • Rendered all four toggle combinations (en_gb_oxendict × use_rust): files present/absent exactly per toggle; mbake validate Makefile passes in both states; rendered ci.yml passes actionlint in all states.
  • Toggle-on renders: markdownlint-cli2 clean; uvx typos@1.48.0 --config typos.toml --force-exclude clean over all rendered Markdown (both pure and Rust variants); make markdownlint exercised end-to-end; committed typos.toml tomllib-parses with the expected 1,766 entries and matches generator output.
  • Full generated quality gates on a toggle-on render: make check-fmt, make lint (ruff, interrogate 100%, pylint 10/10), make typecheck (ty), and pytest (9 passed, including the 8 generator tests).
  • Template contract suite: 35 passed, 2 skipped (act-gated), including 2 new toggle contract cases; the make help snapshot updated for the new target description.

🤖 Generated with Claude Code

Generated repositories now enforce en-GB Oxford ("-ize") spelling in
documentation, mechanizing the mandate the generated documentation
style guide already carries. The mechanism follows stilyagi commit
ee77d08a19bc9c1107f30fc2b5bb63ced979fbc4, taking the generator and its
test module from the leynos/netsuke import (which includes the parse
tests from stilyagi issue #57 so duplicate extend-words keys fail
fast):

- new copier boolean en_gb_oxendict (default true) gates every piece
  via conditional filenames and in-file blocks; toggle-off renders
  carry no trace;
- scripts/generate_typos_config.py renders typos.toml (committed,
  generated by running the templated generator) with the two-layer
  design: the en-gb locale plus generated extend-words entries
  restoring Oxford -ize;
- tests/test_generate_typos_config.py rides the generated pytest
  suite, including the drift check and the issue #57 tomllib parse
  tests (with a tomli fallback for pre-3.11 baselines);
- the Makefile markdownlint target gains a pinned
  `uv tool run typos@$(TYPOS_VERSION)` pass, and the generated CI
  gains a "Lint documentation" step calling make markdownlint;
- AGENTS.md and the developers' guide document the gate, regeneration,
  and where to add stems or accepted words.

Wiring the docs-lint target into CI surfaced pre-existing markdownlint
failures in rendered output (blank-line residue from untrimmed Jinja
blocks in AGENTS.md and README.md, and an over-length line in the
developers' guide); these are fixed so the new gate passes. The typos
gate itself flagged twelve genuine spelling errors in rendered prose
(afterward, summarise, artifact(s), signaling, serialisation,
standardised, emphasises, parameterised, parameterisation), which are
corrected, and one verbatim citation title now carried by an
extend-ignore-re entry.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @leynos, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 14 minutes

Your organization has reached its usage spending cap. Adjust your spending cap in the billing tab.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 0a8cca6b-5345-433c-b262-844081364b3a

📥 Commits

Reviewing files that changed from the base of the PR and between 09a4d88 and 6210613.

📒 Files selected for processing (16)
  • copier.yml
  • template/.github/workflows/ci.yml.jinja
  • template/.rules/python-exception-design-raising-handling-and-logging.md
  • template/.rules/python-pyproject.md
  • template/.rules/python-typing.md
  • template/AGENTS.md.jinja
  • template/Makefile.jinja
  • template/README.md.jinja
  • template/docs/complexity-antipatterns-and-refactoring-strategies.md
  • template/docs/developers-guide.md.jinja
  • template/pyproject.toml.jinja
  • template/tests/{% if en_gb_oxendict %}test_generate_typos_config.py{% endif %}
  • template/{% if en_gb_oxendict %}scripts{% endif %}/generate_typos_config.py
  • template/{% if en_gb_oxendict %}typos.toml{% endif %}
  • tests/__snapshots__/test_template.ambr
  • tests/test_template.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch add-en-gb-oxendict-gate

Comment @coderabbitai help to get the list of available commands.

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