Skip to content

Judge the Prose in Front of a Trailing noqa or pylint Directive - #2814

Merged
ptr727 merged 7 commits into
developfrom
feature/auto-2807
Oct 11, 2026
Merged

ptr727 merged 7 commits into
developfrom
feature/auto-2807

Conversation

@ptr727

@ptr727 ptr727 commented Oct 11, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • NOT_PROSE in the prose gate exempted a whole comment body carrying a trailing # noqa, # type: ignore, or pylint: directive, so the prose in front of the directive was judged by none of comment-wrap, comment-case, and comment-added.
  • The trailing alternatives move out of NOT_PROSE into TRAILING_DIRECTIVE. A new without_trailing_directive cuts the directive off the body before both comment rules read it, comment_wrap_findings doing so before config_run_lines, so a directive's code ending the body cannot make prose read as a configuration run.
  • The trailing forms apply only in a .py file, since no other language's checker reads them, so a TOML, YAML, or shell comment mentioning one mid-sentence is judged as prose.
  • The test that pinned the old whole-body exemption is replaced by tests for each constructed case in the issue and its comment, a directive-only comment still drawing nothing, and the configuration-run ordering. Each new case fails against the code before the fix.
  • A regression sweep of the comment rules over the tree reports no change outside the intended one.

Closes on promotion: #2807

Remaining local review findings

The local strict review's edit budget was spent on the first push and again on the second. The two docstring findings listed from the first push are fixed in ed6f9d7. The three introduced findings below, listed from the second push, are fixed in 686a95b, whose own local pass found nothing.

  • introduced: .github/actions/prose-gate/prose_lint.py, comment_wrap_findings keeps the cut body as the previous line for the continuation check, so a full-line .py comment naming a directive mid-sentence, such as one ending where needed. after a backticked # noqa: E501, is cut to a fragment with no full stop and a lowercase next line is reported as its wrap.
  • introduced: .github/actions/prose-gate/prose_lint.py, no test pins the leading \b in \bpylint:.
  • introduced: .github/actions/prose-gate/prose_lint.py, no test pins the \s* in type:\s*ignore, the spaceless form mypy also reads.

🤖 Generated with Claude Code

ptr727 and others added 3 commits October 11, 2026 08:16
A trailing `# noqa`, `# type: ignore`, or `pylint:` directive exempted
the whole comment body from comment-wrap, comment-case, and
comment-added. The directive is now cut off the body and the prose in
front of it is judged, and the trailing forms apply only in a Python
file, since no other language's checker reads them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A directive's code ends the body where a full stop would, so prose
opening on a key-like word read as configuration and two such lines
formed a run that comment-wrap and comment-case skipped.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The directive can be kept while the prose is deleted, which holds for a
pylint directive that scopes past its own line as well.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Copilot AI lite review requested due to automatic review settings October 11, 2026 15:28
@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: 4492a80e-9102-42ab-98b3-2ba030156d63

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

The cut drops the directive and anything after it, and what it leaves
of a directive-only comment is empty or an anchored directive.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@codecov

codecov Bot commented Oct 11, 2026

Copy link
Copy Markdown

Codecov Report

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

Additional details and impacted files
@@            Coverage Diff             @@
##             develop    #2814   +/-   ##
==========================================
  Coverage           ?   60.30%           
==========================================
  Files              ?       16           
  Lines              ?     8479           
  Branches           ?        0           
==========================================
  Hits               ?     5113           
  Misses             ?     3366           
  Partials           ?        0           
Flag Coverage Δ
python-3.13 60.30% <ø> (?)

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.

🟡 Changes recommended

Two unresolved documentation findings remain: one moderate issue and one nit.

2 open findings
What changed in this PR

This pull request fixes Python trailing-directive handling in the prose gate and adds regression coverage.

Changes:

  • Strips directive suffixes before prose and configuration checks.
  • Preserves exemptions for directive-only comments.
  • Adds Python, non-Python, and ordering tests.
File Summary
tests/​test_prose_lint.py Adds directive-handling regression tests; the test docstring needs more accurate wording.
.github/​actions/​prose-gate/​prose_lint.py Implements Python-specific directive stripping; the docstring should clarify that the full suffix is removed.

🧠 Review effort: Lite


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

Comment thread tests/test_prose_lint.py Resolved
ptr727 and others added 3 commits October 11, 2026 08:32
A full-line comment naming a directive mid-sentence was cut to a
fragment with no full stop, so a lowercase next line read as its wrap.
The continuation now also needs the whole body not to end a sentence.
Tests also pin the leading word boundary of `pylint:` and the spaceless
`type:ignore` form.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@ptr727

ptr727 commented Oct 11, 2026

Copy link
Copy Markdown
Owner Author

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

@ptr727
ptr727 merged commit c1d09a7 into develop Oct 11, 2026
13 checks passed
@ptr727
ptr727 deleted the feature/auto-2807 branch October 11, 2026 15:57
ptr727 added a commit that referenced this pull request Oct 11, 2026
…ilure Reporting Fixes to Main (#2816)

## Summary

Promotes these pull requests from develop to main:

- #2832 Require Every CLI Script to Answer Help and Refuse Unknown
Arguments
- #2833 Exempt nopep8 as a Leading Directive in the Prose Gate
- #2815 Bind the Workspace-Edit Rule Only to an Agent Running Inside VS
Code
- #2813 Record HomeAssistant-Config's Incidental Python as a driftNote
- #2827 Read nopep8 in Any Letter Case in the Prose Gate
- #2825 Spend a Head Refusal a Later Genuine Round on That Head Answers
- #2819 Read noqa and CSpell Directives in Any Letter Case
- #2814 Judge the Prose in Front of a Trailing noqa or pylint Directive
- #2811 Name Why a Windows Tool Install Failed and Print Docker's Status
in UTF-8
- #2808 Read a Tool Name as a Prose Gate Directive Only Where It Opens
the Comment
- #2802 Name a File the Prose Gate Cannot Decode in Its Scope Line
- #2800 Read a First-Line Comment After a Byte Order Mark as Leading in
Every Language
- #2797 Name a Python File the Prose Gate Cannot Parse in Its Scope Line
- #2794 Let the Unattended Orchestrator Retry a Transient Dispatch
Failure
- #2792 Close the Remaining Blocked-Promotion Gaps in the Unattended
Worker
- #2790 Read a Carried Change Set Past the Compare Endpoint's 300-File
Ceiling
- #2784 Let a Round on the Head Outrank pr_review.py wait's Repo-Wide
Quota Reading
- #2782 Say What pr_review.py wait --min-rounds Counts and Name It at
the Timeout
- #2778 Share the Bounded Step Reader Across the Test Harnesses
- #2776 Pin the Prose Gate's Override Wiring by Structure
- #2773 Exempt a List Item's Label Separator from the Dash Rule for
Every Marker and Bold Spelling
- #2771 Strip a List Item's Opening Label for Every Marker and Bold
Spelling in the Prose Gate
- #2768 Page pr_review.py's Changed-File List Past 100 So a Large
Promotion Can State Coverage
- #2765 Let an Attested Local Pass Cover a Head Beside a Table-Less
Copilot Round

Closes #2285
Closes #2820
Closes #2818
Closes #2809
Closes #2807
Closes #1659
Closes #2796
Closes #2798
Closes #2163
Closes #1984
Closes #2614
Closes #2767
Closes #2781
Closes #2741
Closes #2775
Closes #1665
Closes #2770
Closes #2738
Closes #2758
Closes #2739

🤖 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