You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Extend the Sentence-Length Check to Comments and Docstrings - #2836
The opt-in sentence-length check read only Markdown, so an over-cap sentence in a shell, Python, or workflow comment passed locally and in CI. The counting core is now one helper shared by the Markdown reader, a comment reader, and a Python docstring reader. The comment reader reuses comment_wrap_findings' prose filters. The check stays opt-in and the Markdown behavior is unchanged.
Local strict review ran two rounds. Known remaining gaps, left unfixed past the edit budget:
introduced: an indented table under a colon line in a non-Python comment is read as prose, since comment extraction strips the indent.
introduced: NumPy-style docstring sections are joined into one sentence.
introduced: a docstring whose closing quotes sit on its last code line misses the code-block indent base.
introduced: Google-style Args: bodies are treated as code, so a long sentence there is not checked.
Pre-existing: TestDiffScopeFloor.test_a_deliberately_narrowed_scan_is_not_told_the_narrowing_is_a_defect fails on develop in this environment too.
Share the comment filters with the wrap check, split bullets and fields,
treat a colon-led indented block as code, separate adjacent docstrings,
expand tabs, and mask double-backtick spans.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
A capitalized comment line starts a new sentence as comment-wrap reads it,
a Sphinx field line starts a field, and implicit string concatenation inside
a docstring no longer reads as two adjacent docstrings.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 60.26%. Comparing base (4035555) to head (9c69479). ⚠️ Report is 1 commits behind head on develop.
Normalize numbered comment markers before word counting
.github/actions/prose-gate/prose_lint.py:2702
Bug: numbered comment markers are counted as words here. # 1) <25 prose words>. therefore becomes 26 words and is reported, even though comment_wrap_findings already strips ENUM_PREFIX before judging the same comment. Normalize the body before appending it to keep the sentence-length reader consistent and avoid a false positive at the cap.
Include sentence-length in parsed rules for docstring coverage
.github/actions/prose-gate/prose_lint.py:2850
Bug: this new docstring path depends on python_tree(), but sentence-length is not included in PARSED_RULES. When a Python file is invalid or uses syntax this interpreter cannot parse, python_docstring_spans() returns no spans and the docstring prose is silently skipped, with no unparsed warning. Include this rule in the parsed-rule set and add a regression test for the incomplete-coverage path.
Both previously-missed findings (numbered comment markers counted as words, and sentence-length missing from PARSED_RULES) were real and are fixed in 9c69479, each with a test that fails without the fix.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
Two unresolved moderate findings remain in the sentence-analysis implementation.
0 open findings
Previously missed (1)
In code that hasn't changed since last review
Do not infer docstring boundaries from quote characters in content
.github/actions/prose-gate/prose_lint.py:2733
Bug: this heuristic treats a quote at the start of a column-zero docstring content line as an adjacent docstring opener. A module docstring can legally contain lines such as word ... " followed by " word ...; the groups split at this point, so the 26-word sentence is measured as two fragments and passes. Track actual AST string boundaries (or require the delimiter to be the node's opener) instead of inferring a new docstring from quote characters in the text.
Previously-missed finding on quote-inferred docstring boundaries is real but a rare false negative (a module docstring with a column-zero quote-opening line right after a quote-ending line). Filed under #2838 rather than fixed here, since the correct fix changes python_docstring_spans.
…ted Wait Hold to Main (#2840)
## Summary
Promotes [#2836](#2836)
and [#2837](#2837) to
main.
- `prose_lint.py`'s opt-in `sentence-length` check now reads code
comments outside Markdown and Python docstrings, scoped to changed lines
the way Markdown already was. The `comment-and-doc-style` Skill names
the wider scope.
- `pr_review.py wait` holds an attested head on a BLOCKED merge while a
check the base branch's rules require has not registered. An unreadable
rules read keeps the old behavior and says so. `attest` waits up to 60
seconds for a push GitHub has not registered yet, only where the remote
branch already holds the checkout's commit.
Follow-ups filed: #2838 (sentence-length gaps past the edit budget) and
#2839 (required-check matching ignores the rule's `integration_id`).
Closes#2430Closes#2750
🤖 Generated with [Claude Code](https://claude.com/claude-code)
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
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.
Closes #2430
The opt-in
sentence-lengthcheck read only Markdown, so an over-cap sentence in a shell, Python, or workflow comment passed locally and in CI. The counting core is now one helper shared by the Markdown reader, a comment reader, and a Python docstring reader. The comment reader reusescomment_wrap_findings' prose filters. The check stays opt-in and the Markdown behavior is unchanged.Local strict review ran two rounds. Known remaining gaps, left unfixed past the edit budget:
Args:bodies are treated as code, so a long sentence there is not checked.TestDiffScopeFloor.test_a_deliberately_narrowed_scan_is_not_told_the_narrowing_is_a_defectfails on develop in this environment too.🤖 Generated with Claude Code