Skip to content

fix(tools): exclude a preceding slash from the glued-doc-comment guard - #104

Merged
MikeGrier merged 2 commits into
mainfrom
mikegrier/fix-guard
Sep 18, 2026
Merged

MikeGrier merged 2 commits into
mainfrom
mikegrier/fix-guard

Conversation

@MikeGrier

Copy link
Copy Markdown
Owner

Cherry-picked from 2d84894 onto a branch that had already removed the end-of-line anchor by another route (d536a43, then b0a29ef dropped the ^.* wrapper it left behind), so the two sides were parallel fixes of the same guard and each carried a piece the other lacked. The pattern that lands is [^\s/]///: HEAD's unanchored form, which is the cheap one -- ^.* matches to end of line and then backtracks hunting for the marker, on every line of every file -- plus the cherry-pick's exclusion of a preceding slash.

That exclusion is the whole substance of the pick here. \S/// flags a //// banner comment, because the banner's third slash is itself a non-space character; this repository happens to contain no such banner, so the false positive was latent rather than firing.

Verified in both directions rather than only on the reject side: the glued line form (let x = 1;/// The next thing), the bare glued marker, and a sentence welded to a closing fence are each flagged with the right line number, while a //// banner -- planted as the control -- leaves the run clean. All tracked files still pass.

The commit's PLANS.md hunk is dropped. It predates this branch's root PLANS.md and would have replaced a thirteen-crate tracker list with a two-crate one and declared no checklists active over a table of eight; the link repair it was made for is already present here. It applied without conflict, which is why it had to be caught by eye rather than by git.

Cherry-picked from 2d84894 onto a branch that had already removed the
end-of-line anchor by another route (d536a43, then b0a29ef dropped the
`^.*` wrapper it left behind), so the two sides were parallel fixes of the
same guard and each carried a piece the other lacked. The pattern that lands
is `[^\s/]///`: HEAD's unanchored form, which is the cheap one -- `^.*`
matches to end of line and then backtracks hunting for the marker, on every
line of every file -- plus the cherry-pick's exclusion of a preceding slash.

That exclusion is the whole substance of the pick here. `\S///` flags a
`////` banner comment, because the banner's third slash is itself a non-space
character; this repository happens to contain no such banner, so the false
positive was latent rather than firing.

Verified in both directions rather than only on the reject side: the glued
line form (`let x = 1;/// The next thing`), the bare glued marker, and a
sentence welded to a closing fence are each flagged with the right line
number, while a `////` banner -- planted as the control -- leaves the run
clean. All tracked files still pass.

The commit's PLANS.md hunk is dropped. It predates this branch's root
PLANS.md and would have replaced a thirteen-crate tracker list with a
two-crate one and declared no checklists active over a table of eight; the
link repair it was made for is already present here. It applied without
conflict, which is why it had to be caught by eye rather than by git.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings September 18, 2026 20:29
@MikeGrier
MikeGrier enabled auto-merge September 18, 2026 20:29

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

No unresolved issues remain, and the reviewed change preserves detection while removing the banner-comment false positive.

Pull request overview

Updates the doc-comment guard to ignore //// banner comments while still detecting glued /// markers.

Changes:

  • Replaces \S/// with [^\s/]///.
  • Documents the corrected behavior and rationale.
File summaries
File Summary
tools/check-encoding.ps1 Excludes preceding slashes from glued-doc detection.
DESIGN-NOTES.md Documents the refined guard behavior.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Lite

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

@MikeGrier
MikeGrier merged commit 48bdc25 into main Sep 18, 2026
28 checks passed
@MikeGrier
MikeGrier deleted the mikegrier/fix-guard branch September 18, 2026 20:35
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