Skip to content

Read the Six Layouts the Sentence-Length Check Misread - #2846

Merged
ptr727 merged 4 commits into
developfrom
feature/2838-sentence-length-layouts
Oct 11, 2026
Merged

ptr727 merged 4 commits into
developfrom
feature/2838-sentence-length-layouts

Conversation

@ptr727

@ptr727 ptr727 commented Oct 11, 2026

Copy link
Copy Markdown
Owner

Fixes #2838

The opt-in sentence-length check read six layouts wrongly in comments and docstrings. Each now has a constructed test that fails with its fix reverted.

  • List markers (-, *, +, 1., 1)) are stripped by one shared helper, strip_list_marker, called by the Markdown, comment, and docstring readers.
  • Docstring boundaries come from the AST string nodes (python_docstrings), so a column-zero line opening with a quote no longer splits one docstring in two.
  • The docstring indent base is the column the quotes open at, so a closing quote on the last code line sets nothing. A docstring sharing its opening line with code takes the body one level in from that line.
  • NumPy sections: header plus underline and name : type lines are structure, each description paragraph is its own unit.
  • Google sections (Args, Returns, Raises, Yields, Attributes and the near forms): entries are prose units and the name: lead is no word. Examples: stays code.
  • An indented run after a colon line in a non-Python comment is not prose, using the comment's own indent from extraction and the shared indented_past rule.

Two local strict-review rounds ran and are spent. Layouts they found and this change does not fix are filed as #2843.

🤖 Generated with Claude Code

ptr727 and others added 3 commits October 11, 2026 14:52
List markers are stripped in one shared helper for Markdown, comments, and docstrings.
Docstring boundaries come from the AST string nodes and the indent base from the quote column.
NumPy and Google sections are structure plus prose units, and an indented run under a colon
comment line is a block rather than prose.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Copilot AI lite review requested due to automatic review settings October 11, 2026 22:20
@coderabbitai

coderabbitai Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: Repository: ptr727/ProjectTemplate/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f6a8fb90-ecaf-4f19-844a-48c92d8d0d53

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Three unresolved moderate findings can cause valid over-cap sentences to be missed.

1 open finding
What changed in this PR

Improves the opt-in sentence-length check across Markdown, comments, and Python docstrings.

Changes:

  • Adds shared list-marker and indentation handling.
  • Improves AST-based docstring boundaries and NumPy/Google section parsing.
  • Adds regression tests for supported layouts.
File Summary
tests/​test_prose_lint.py Adds regression coverage for supported layouts.
.github/​actions/​prose-gate/​prose_lint.py Updates sentence parsing; three unresolved moderate findings remain: NumPy continuations (2 votes), blank non-Python comment lines (1 vote), and wrapped Google entries (1 vote).

🧠 Review effort: Lite


💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@codecov

codecov Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 60.49%. Comparing base (8729928) to head (954a46c).
⚠️ Report is 1 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2846      +/-   ##
===========================================
+ Coverage    60.47%   60.49%   +0.02%     
===========================================
  Files           16       16              
  Lines         8528     8534       +6     
===========================================
+ Hits          5157     5163       +6     
  Misses        3371     3371              
Flag Coverage Δ
python-3.13 60.49% <ø> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ptr727

ptr727 commented Oct 11, 2026

Copy link
Copy Markdown
Owner Author

A recorded local strict-review pass covers head 954a46c9e07155ec5dfcd43f39e10c8d7df7d975, the content this pull request carries at that commit against develop, and it recorded 1 finding.

@ptr727
ptr727 merged commit ebff68d into develop Oct 11, 2026
13 checks passed
@ptr727
ptr727 deleted the feature/2838-sentence-length-layouts branch October 11, 2026 22:36
ptr727 added a commit that referenced this pull request Oct 11, 2026
…th Layouts to Main (#2847)

## Summary

Promotes [#2842](#2842)
and [#2846](#2846) to
main.

- `pr_review.py wait`'s required-check hold now honors a ruleset entry's
`integration_id`. A bound entry is met only by a same-name CheckRun from
that app, so a same-name check from another app, or a commit status, no
longer ends the hold. The CHECKS_PENDING message names the unmet
required contexts.
- `prose_lint.py`'s opt-in `sentence-length` check reads six layouts it
misread: list markers no longer count as words (one shared helper for
Markdown, comments, and docstrings), docstring boundaries come from the
AST, a closing quote on a code line no longer sets the indent base,
NumPy and Google docstring sections read as structure plus prose, and an
indented block under a colon comment line is not joined into prose.

Follow-up filed: #2843 (the sentence-length layouts left past the edit
budget).

Closes #2838
Closes #2839

🤖 Generated with [Claude Code](https://claude.com/claude-code)
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