Skip to content

Promote the Configuration-Snippet Comment Exemption to Main - #1704

Merged
ptr727 merged 2 commits into
mainfrom
develop
Sep 20, 2026
Merged

ptr727 merged 2 commits into
mainfrom
develop

Conversation

@ptr727

@ptr727 ptr727 commented Sep 19, 2026

Copy link
Copy Markdown
Owner

Promotes the configuration-snippet exemption from develop to main. The delta is one squash commit, 1fa927a, three files, 141 insertions.

What it carries

comment-case reports a comment line whose sentence opens in lowercase, and a configuration snippet pasted into a comment opens on a lowercase key, so no form of one could pass. The rule and a copy-pasteable snippet were mutually exclusive, and the only spellings that passed each changed the line a reader copies.

A comment body of one key, a colon and one value is now configuration rather than a sentence, exempt from comment-case and comment-wrap, sitting beside the lone-key exemption that already covered the # packages: line above the one that failed. Clearing the wrap with it is what a multi-line snippet needs.

The guard reads its own terminator set rather than SENT_END, whose set carries the colon. A colon ends configuration rather than a sentence here, which is why the lone-key exemption exists, and reading it as a terminator refused address: fd00::, image: ghcr.io/o/n: and root: C:.

What it costs, stated where the pattern is

  • A marker comment, the common loss: # todo: refactor is the same shape as a config line.
  • A sentence wrapping through such a body, which loses its wrap.
  • A refusal that loses no detection: a value ending in a full stop is judged as before, an FQDN being the case, and the terminator set cannot drop the full stop without dropping the guard.

is_comment_prose deliberately does not carry the exemption, unlike its three siblings, so comment-added still prices an added # key: value line. An earlier round added it for symmetry and that was reverted, since comment-added reads a body of any case and the exemption there would have freed Owner: alice from the label as well.

Measured over the tree the exemption changes no finding and newly reaches one body, a command to paste.

Review record

Two Copilot rounds on this promotion. The first stated reviewed=3 changed=3 findings=1, full coverage of the three-file diff. The second, on the current head, states no coverage, which is the nondeterminism recorded on #1692. The file set is the same three files at both heads, so the first round's statement covers exactly the paths being promoted, and only their content moved in between.

One thread, answered and resolved. Eight local adversarial passes on the feature branch, finding 9, 7, 7, 3, 2, 2, 1 and 1.

The one item left open when this promotion was opened is now fixed rather than carried. In scripts/README.md the phrase "that set" bound to SENT_END's set under a nearest-antecedent reading, where the code and the test docstring both name SNIPPET_END outright. #1705 names it explicitly and merged as 4f0418b6, which is this promotion's current head.

The follow-up that record called for is filed as #1706: a rule's reach is written out on three hand-authored surfaces, and the churn measured here came from that rather than from any difficulty in the two-line fix.

Fixes #1700

`comment-case` reports a comment line whose sentence opens in lowercase, and
a configuration snippet pasted into a comment opens on a lowercase key, so no
form of one could pass. The rule and a copy-pasteable snippet were mutually
exclusive.

A comment body of one key, a colon and one value is now configuration rather
than a sentence, and neither that rule nor `comment-wrap` applies to it. It
sits beside the lone-key exemption, which already covered the `# packages:`
line above the one that failed. Clearing the wrap with it is what a
multi-line snippet needs, each snippet line no longer reading as a
continuation of the one above it.

The guard reads its own terminator set rather than `SENT_END`, whose set
carries the colon. A colon ends configuration rather than a sentence here,
which is why the lone-key exemption exists, and reading it as a terminator
refused `address: fd00::`, `image: ghcr.io/o/n:` and `root: C:`.

Two detections are lost and one shape is refused, each stated where the
pattern is. A marker comment such as `todo: refactor` is the common loss,
since it is the same shape as a config line. A sentence wrapping through such
a body loses its wrap. And a value ending in a full stop is refused, an FQDN
being the case, which loses no detection but removes none either.

`is_comment_prose` deliberately does not carry the exemption, unlike its
three siblings, since `comment-added` reads a body of any case and exempting
the shape there would free `Owner: alice` from the label as well.

Measured over the tree the exemption changes no finding and newly reaches one
body, a command to paste.
Copilot AI lite review requested due to automatic review settings September 19, 2026 22:26
@coderabbitai

coderabbitai Bot commented Sep 19, 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: 562ddf9c-69b3-4c0c-bd05-15c0928aa89f


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.

Copilot review overview

🟡 Changes recommended

scripts/README.md contains an ambiguous antecedent ("that set") in the newly added exemption documentation that should be made explicit for accuracy and maintainability.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 Low severity

Open (1)
What changed in this PR

Promotes the prose-gate exemption that treats single-line key: value comment bodies as configuration (not prose), so copy-pasteable configuration snippets no longer conflict with comment-case and comment-wrap.

Changes:

  • Add SNIPPET + SNIPPET_END patterns to exempt key: value comment bodies (with a guard that keeps sentence-like values judged).
  • Expand the prose-lint test suite to cover the new exemption, its guard rails, and multiple comment syntaxes.
  • Document the new exemption (and its tradeoffs) in scripts/README.md.
File Description
.github/​actions/​prose-gate/​prose_lint.py Adds the SNIPPET exemption and guard so config snippets in comments are not treated as wrapped lowercase prose.
scripts/​tests/​test_prose_lint.py Adds targeted regression tests for snippet comments, guard behavior, and cross-syntax extraction.
scripts/​README.md Documents the new exemption, guard, and known tradeoffs for readers of the lint rules.

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

Comment thread scripts/README.md Outdated
Answers the one review thread on the promotion #1704.

`scripts/README.md` ended a sentence with "that set cannot drop the full
stop without dropping the guard". The nearest prior set in that
paragraph is `SENT_END`'s, introduced by the same sentence that
contrasts the two, so the claim read as being about the wrong set and is
false of it: dropping the full stop from `SENT_END` has no bearing on
this guard.

It now names `SNIPPET_END`, which the code comment and the test
docstring already did. A grep for the sentence confirms all three
surfaces state it the same way.

## Two open, recorded rather than fixed

A local pass over this commit found two more in the same paragraph.
Neither affects behavior and neither is what the promotion thread
raised, so they are written down here rather than taken in a further
round.

- **One clause earlier, the same mis-binding.** "a body ending as a
sentence is judged as one, the guard `is_tool_directive` pairs with its
own anchor and for the same reason. That guard reads its own terminator
set rather than `SENT_END`". The nearest referent for "That guard" is
the guard `is_tool_directive` pairs with, and that guard *is*
`SENT_END`, so as written the sentence says `SENT_END` reads a set other
than itself. The code comment avoids it by naming `SNIPPET_END` at the
contrast point; the README names it four sentences later.
- **An overstatement on all three surfaces.** "`SNIPPET_END` cannot drop
the full stop without dropping the guard" is not true of the pattern.
Dropping `.` leaves `[!?]["')\]]?\s*$`, which still refuses `conclusion:
wrong!`, one of the bodies the suite pins as judged. The guard would be
narrowed rather than dropped. The true claim is narrower: dropping the
full stop would re-exempt the wrapped-sentence case the guard exists
for, `hand: correctly.`, which is the same shape as the refused `origin:
example.com.`.

The second is the one worth fixing, and it is a three-surface change
rather than a one-line one.

Closes on promotion: nothing of its own. This exists to unblock #1704.
Copilot AI review requested due to automatic review settings September 20, 2026 00:09

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.

Copilot review overview

🟢 Approval recommended

The exemption is narrowly implemented, explicitly guarded against prose-like endings, and is backed by comprehensive tests that pin both intended behavior and acknowledged tradeoffs.

Review effort: Lite
Findings: None

Resolved since last review (1)

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.

Prose Gate comment-case Rejects Every Config Snippet in a Comment

2 participants