Repository navigation
fix(skills/addressing-review-feedback): let the comment gate see JSX comments - #88
Conversation
… .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>
There was a problem hiding this comment.
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
.jsxand.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>
…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>
Review round: Copilot review 5427058451 on bcce939Findings: 1 inline finding, no suppressed findings.
Comment gate (
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". |

Description
Fixes #87
The comment gate did not see a JSX comment,
{/* … */}, in a.jsxor.tsxfile. 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,.jsxand.tsxhave their own comment family, which also reads the JSX forms of a comment.Changes
comment_growth.py: a newJSXfamily for.js,.jsxand.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 ofSLASH..jsis in the family because JSX often stands in plain.jsfiles. In JS, a line that starts with{/*is almost always JSX. An empty body that holds a comment, as infunction f() {/* noop */}, does not start its line with{, so it stays code.{//or{ //is not read as a comment. An object literal can open that way, as in{ // homein an array of routes, and that line is code. Only JSX context could tell the two apart, and the gate reads lines, not grammar..ts,.mjs,.cjsor.cfiles, 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,.cjsand.cfiles, 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 printa.tsx:4 CHANGEDnext tob.ts:2 CHANGED,2 listed, where beforea.tsxwas missing.🤖 Generated with Claude Code