Sweep the non-.rst prose for staleness - #339
Merged
Merged
Conversation
Four sites, two kinds of drift. #334 moved the guide to the Policy spellings that type-check, but only the hand-written .rst. Four _policy.py docstrings teach the old ones and autodoc renders them into modules.html, so the API reference and the guide disagreed on the same page. Worse, #337's new runtime warning hands the user Policy(segment_scripts=()) -- the library telling you, in a package that ships py.typed, to write an arg-type error. A test now pins the offered spelling; the warning tests matched on 'ja_segmenter' and never checked the actionable half of the message. Two stage headers understated their inputs. _extract declared only the two delimiter policy fields while reading three Lexicon suffix fields through _suffix_shaped, which is not a detail: that is the mechanism letting a clause's content overrule the delimiter, and #335 would extend it. _post_rules omitted Policy.middle_as_family. Checked mechanically rather than by eye: every stage's declared Reads against the policy and lexicon attributes it actually touches. _script_segment, _tokenize, _assign, _group and _classify were already accurate. _vocab has no Reads line by design, being a helper whose predicates take vocabulary explicitly. Its 'no state' claim still holds.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #339 +/- ##
=======================================
Coverage 98.48% 98.48%
=======================================
Files 41 41
Lines 2845 2845
=======================================
Hits 2802 2802
Misses 43 43 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Step 0 said 'review docs/ for anything stale' and named only .rst files and AGENTS.md. That misses the three sites this sweep actually found drift in, and it does not say the method: grepping for the changed SYMBOL finds almost none of this, because prose describes behavior in words rather than identifiers. The sites are listed now, each one having gone stale at least once, with the autodoc case called out for why an .rst-only sweep cannot catch it. The stage-header check is given as a command rather than an instruction to read carefully, since it is mechanical.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The last item on the 2.1 docs list: the places prose goes stale that
grepover.rstmisses. Four sites, two kinds of drift.The Policy spellings didn't reach the docstrings
#334 moved the guide to the spellings that type-check, but only the hand-written
.rst. Four_policy.pydocstrings still taught the old ones, and autodoc renders them intomodules.html— so the API reference and the guide disagreed on the same page._policy.py:566Policy(maiden_delimiters={("(", ")")})frozenset({("(", ")")})_policy.py:587script_orders={}script_orders=()_policy.py:605segment_scripts=()segment_scripts=frozenset()_policy.py:625maiden_delimiters={("(", ")")}frozenset({...})Verified:
grepfor the old spellings in the rebuiltmodules.htmlnow returns 0.The runtime warning was handing users an arg-type error
Sharper than the docstrings, because it reaches users who never open the docs. #337's new warning ends:
A user pastes that verbatim, and in a package that ships
py.typedit fails mypy. NowPolicy(segment_scripts=frozenset()).Nothing pinned this. The warning tests match on
r"ja_segmenter"and never checked the deactivation hint, which is the actionable half of the message. Added a test asserting the offered spelling is the one that type-checks, and that the old one is absent.Two stage headers understated their inputs
Checked mechanically — every stage's declared
Reads:against thepolicy.*/lexicon.*attributes it actually touches — rather than by eye._extractdeclared only the two delimiter policy fields while readingsuffix_words,suffix_acronymsandsuffix_acronyms_ambiguousthrough_suffix_shaped. Not a detail: that is the mechanism letting a clause's content overrule the delimiter's verdict ((MBA)is not a nickname), and it is the one Parenthesized(née Jones)parses as a nickname where the barenée Jonesgives maiden #335 would extend._post_rulesomittedPolicy.middle_as_family._script_segment,_tokenize,_assign,_groupand_classifywere already accurate._vocabhas noReads:line by design, being a helper whose predicates take vocabulary as explicit parameters; its "no state" claim still holds.Verification
uv run pytest -q— 3065 passed (was 3064; one new test)uv run mypy,uv run ruff check— cleansphinx-build -b html— exit 0, 0 warningssphinx-build -b doctest— exit 0🤖 Generated with Claude Code