Skip to content

fix(skills/addressing-review-feedback): let the comment gate see JSX comments - #88

Merged
sourcehawk merged 3 commits into
mainfrom
fix/jsx-comments-missed-by-gate
Oct 6, 2026
Merged

sourcehawk merged 3 commits into
mainfrom
fix/jsx-comments-missed-by-gate

Conversation

@sourcehawk

@sourcehawk sourcehawk commented Oct 6, 2026 •

Copy link
Copy Markdown
Owner

Description

Fixes #87

The comment gate did not see a JSX comment, {/* … */}, in a .jsx or .tsx file. So it did not list a JSX comment that changed in a review round, and it did not flag one that grew. The script recognised a comment only when its line started with // or /*, and a JSX comment line starts with {/*. Now .js, .jsx and .tsx have their own comment family, which also reads the JSX forms of a comment.

Changes

  • comment_growth.py: a new JSX family for .js, .jsx and .tsx. It keeps // and /* … */. It adds {/* … */} and { /* … */ } with a space after the brace. A JSX line comment that stands inside braces on lines of its own, { / // … / }, is read through //. These three extensions move out of SLASH.
  • .js is in the family because JSX often stands in plain .js files. In JS, a line that starts with {/* is almost always JSX. An empty body that holds a comment, as in function f() {/* noop */}, does not start its line with {, so it stays code.
  • A line that starts with {// or { // is not read as a comment. An object literal can open that way, as in { // home in an array of routes, and that line is code. Only JSX context could tell the two apart, and the gate reads lines, not grammar.
  • The other slash-family files do not change. In .ts, .mjs, .cjs or .c files, a line that starts with {/* is still code, usually an empty block that holds a comment.

Testing

The script tests pass: 136 tests, run through the bounded wrapper at --memory 512M. The new tests were written first, in three steps, and each step failed before its fix. They cover a one-line JSX comment, a multi-line one that closes with */}, a changed one that is listed, a grown one that is flagged, { /* … */ }, a line comment inside braces, and JSX comments in .js. Guard tests keep these as code: {/* in .ts, .mjs, .cjs and .c files, an empty function body {/* … */} after ), and an object literal that opens with {// or { //. One test replays the issue's reproduction. In a scratch repository, the issue's steps now print a.tsx:4 CHANGED next to b.ts:2 CHANGED, 2 listed, where before a.tsx was missing.

🤖 Generated with Claude Code

… .tsx files

The comment gate read a comment only when its line started with // or /*. A JSX comment between tags starts with {/*, so the gate did not list a JSX comment that changed, and did not flag one that grew.

The .jsx and .tsx files now have their own comment family. It reads {/* ... */} as a delimited block, and it keeps // and /* ... */. The other files of the slash family do not change: in them, a line that starts with {/* is code.

Fixes #87

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 6, 2026 09:13

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 focused implementation resolves the reported gap with comprehensive regression coverage.

Review effort: Balanced
Findings: None

What changed in this PR

Adds JSX-aware comment detection to the review-feedback comment gate, resolving issue #87.

Changes:

  • Adds a JSX comment family for .jsx and .tsx.
  • Preserves slash-comment handling and adds unit/integration coverage.
File Description
comment_growth.py Recognizes {/* … */} comments in JSX files.
test_comment_growth.py Tests JSX detection, growth, reporting, and regressions.

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

…s and after a space

The JSX family read only {/* ... */}. A JSX comment can also stand as { /* ... */ } with a space after the brace, or as a line comment {// ... on its own line, and the gate did not list those. JSX also stands in plain .js files, which were still in the slash family.

The JSX family now reads both forms, and .js moves into it. In JS, a line that starts with {/* is almost always JSX. An empty body that holds a comment stands after ") " on its line, so it stays code. "{ //" stays code, because an object literal can open that way. The .mjs and .cjs files stay in the slash family.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 6, 2026 10: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.

Copilot review overview

🟡 Changes recommended

The {// marker misclassifies valid object or block openings without whitespace as standalone JSX comments.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)

Comment thread skills/addressing-review-feedback/scripts/comment_growth.py Outdated
…n with {// as code

The JSX family read a line that starts with {// as a line comment. An object literal can open that way, as in {// home in an array of routes, so the gate listed a code line as a comment. Only JSX context could tell the two apart, and the gate reads lines, not grammar.

The marker is gone. A JSX line comment that stands inside braces on lines of its own is still read through //.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 6, 2026 10:33
@sourcehawk

Copy link
Copy Markdown
Owner Author

Review round: Copilot review 5427058451 on bcce939

Findings: 1 inline finding, no suppressed findings.

  • comment_growth.py:48, "{// misclassifies object literals": applied in e728f81. The {// marker is gone, and a guard test covers {// home and { // home. The reply is in the thread.

Comment gate (comment_growth.py, review base 29c1111): 1 flag, the comment on the JSX family, which grew from 2 to 4 lines. A fresh evaluator judged it.

Declaration Lines at base → now Sentence Base or added Verdict Source Reason Judge
JSX (comment_growth.py:49) 2 → 4 A comment between JSX tags stands in braces, {/* ... */}. base KEEP JSX syntax, outside the file: why {/* is a delimiter evaluator
Only these file types read a line that starts with {/* as a comment: in the others it is code. base KEEP Why {/* is a delimiter only in this family evaluator
A line that starts with "{//" or "{ //" is not a comment, because an object literal can open that way. added KEEP Line 49 (no {// marker), test_object_that_opens_with_a_line_comment_is_code Why the plainer version, with a {// marker, does not work evaluator

In the push before this round (bcce939), the evaluator cut the word "often" from the earlier version of the last sentence ("an object literal often opens that way"), because nothing showed how frequent that form is. The sentence then read "can open that way".

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 focused parser change resolves the reported gap and includes comprehensive regression coverage.

Review effort: Balanced
Findings: None

Resolved since last review (1)

@sourcehawk
sourcehawk merged commit 0b3b34a into main Oct 6, 2026
6 checks passed
@sourcehawk
sourcehawk deleted the fix/jsx-comments-missed-by-gate branch October 6, 2026 14:31
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.

addressing-review-feedback: the comment gate does not see JSX comments in .tsx and .jsx files

2 participants