Skip to content

Treat a Tool Directive Line as No Previous Sentence in the Comment Wrap Rule - #2893

Merged
ptr727 merged 5 commits into
developfrom
feature/2885-wrap-directive
Oct 12, 2026
Merged

ptr727 merged 5 commits into
developfrom
feature/2885-wrap-directive

Conversation

@ptr727

@ptr727 ptr727 commented Oct 12, 2026

Copy link
Copy Markdown
Owner

Fixes #2885. comment_wrap_findings no longer keeps a line is_tool_directive matches as the previous body, so the comment line after # nosec B404 is not reported as that line's wrapped continuation (sibling of #2828 / #2878).

Behavior: a lowercase line after a directive is now judged by comment-case (capitalizing passes), a directive followed by a directive draws nothing, a plain two-line wrap and a sentence wrapping into a directive still draw comment-wrap. Four of the five new tests fail with the fix reverted. One existing comment edit (the note above TOOL_DIRECTIVE), hence the comments label.

Local review findings (7 raised, two rounds): fixed the over-claiming TOOL_DIRECTIVE note, the missing case/reverse-wrap/trailing-directive tests. Accepted pre-existing/by issue shape: a directive whose written reason wraps onto a lowercase line now draws comment-case instead of comment-wrap, and capitalizing it clears the gate; RUN_ON still reads directive bodies; "exempt" in the note elides the is_tool_directive no-full-stop condition (wording predates this change).

🤖 Generated with Claude Code

…ap Rule

Fixes #2885. comment_wrap_findings no longer keeps a line is_tool_directive matches as the previous body, so the comment line after a directive is not read as its continuation. Tests are in their own class; the issue's case and the directive-after-directive case fail with the fix reverted.
…nd Reverse-Wrap Outcomes

Edits the existing design note above TOOL_DIRECTIVE, hence PROSE_ALLOW_COMMENTS=1. A lowercase line after a directive is judged for comment-case, and a sentence wrapping into a directive still draws comment-wrap.
…Directive Case

The note over-claimed an exemption: comment-wrap only declines to read a directive as a wrapping sentence.
Copilot AI lite review requested due to automatic review settings October 12, 2026 18:04
@ptr727 ptr727 added the comments Permits the comment lines the pull request adds or edits, which the prose gate otherwise refuses label Oct 12, 2026
@coderabbitai

coderabbitai Bot commented Oct 12, 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: c2050ba4-1737-4fab-8fd7-e3fe4dd9d9a2

  • 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.

@codecov

codecov Bot commented Oct 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (develop@1d906ad). Learn more about missing BASE report.

Additional details and impacted files
@@            Coverage Diff             @@
##             develop    #2893   +/-   ##
==========================================
  Coverage           ?   59.63%           
==========================================
  Files              ?       16           
  Lines              ?     8683           
  Branches           ?        0           
==========================================
  Hits               ?     5178           
  Misses             ?     3505           
  Partials           ?        0           
Flag Coverage Δ
python-3.13 59.63% <ø> (?)

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.

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.

🟢 Approval recommended

The only remaining comment is a minor docstring nit and does not block approval.

1 open finding
What changed in this PR

Updates prose linting so tool-directive lines do not become preceding wrapped sentences.

Changes:

  • Reset wrap tracking after tool directives.
  • Add regression tests for directive and wrapping cases.
  • Clarify directive handling documentation.
File Description
tests/​test_prose_lint.py Adds regression coverage for directive wrapping behavior.
.github/​actions/​prose-gate/​prose_lint.py Updates wrap-state handling and documentation.

🧠 Review effort: Lite


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@ptr727

ptr727 commented Oct 12, 2026

Copy link
Copy Markdown
Owner Author

A recorded local strict-review pass covers head 8673bb78c13659df3a57547bb610482fae242dd5, the content this pull request carries at that commit against develop, and it recorded 0 findings.

@ptr727
ptr727 merged commit 7930a22 into develop Oct 12, 2026
13 checks passed
@ptr727
ptr727 deleted the feature/2885-wrap-directive branch October 12, 2026 18:19
ptr727 added a commit that referenced this pull request Oct 12, 2026
…ge Rows, and Directive Comment Wrap to Main (#2894)

- #2890 documents the dispatch guard for a schedule that never
publishes, in D4.1 and the catalog snippet notes
- #2891 skips file-table rows when reading partial coverage markers
- #2893 treats a tool directive line as no previous sentence in the
comment-wrap rule

Closes #2849
Closes #2886
Closes #2885

🤖 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

comments Permits the comment lines the pull request adds or edits, which the prose gate otherwise refuses

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants