D3-CR-F7 — Accept comments adjacent to re-export from - #59
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe re-export scanner now detects block comments and module strings that directly follow ChangesRe-export scanner
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This localized test-only change broadens re-export detection for comments adjacent to from without changing production behavior, dependencies, or permissions; no actionable merge-blocking risk remains after normal checks and review. Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 95e2ab2fc2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| // optional whitespace and/or block comments between `from` and the module | ||
| // string. The separator after `from` is `\s*`, not `\s+`, so a block comment | ||
| // (or the quote itself) may abut `from` directly, e.g. `from/* c */'S'`. | ||
| /\bexport\b(?:\/\*[\s\S]*?\*\/|[^'"])*?\bfrom\s*(?:\/\*[\s\S]*?\*\/\s*)*['"]([^'"]+)['"]/g, |
There was a problem hiding this comment.
Restrict the match to an actual re-export clause
When any exported declaration is followed by a comment containing compact example text such as export const safe = true; // docs: from'../domain/example.js', the new \s* branch treats that comment text as a re-export and reports the example path as a real dependency. The prefix can scan across statement and comment boundaries, so this newly produces false purity failures for otherwise valid host source; ensure from belongs to the export clause or lexically exclude comments before accepting the adjacent quote.
Useful? React with 👍 / 👎.
|
@codex review |
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
Codex Review: Didn't find any major issues. 🚀 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Purpose
Stacked validation PR repairing D3-CR-F7 (
CURRENT/P3).Parent affected HEAD:
24efb0a7b5e553e7e025fed748f65c037f5ddf13(PR #58).Defect
The Cockpit host purity scanner's re-export pattern required whitespace immediately after
from(\bfrom\s+), so valid static re-exports with a block comment abuttingfromwere missed — letting a forbidden dependency bypassforbiddenIn():export { x } from/* note */'../domain/foo.js';export * from/* note */'../domain/foo.js';(star)export type { T } from/* note */'../domain/foo.js';(type)The F6 whitespace form (
from /* note */ '...') was already handled and remains so.Repair
Changed file exactly:
tests/cockpit-host/purity.test.tsSmallest repair — in the re-export scanner only:
Explicitly:
Regression coverage
from;fromValues/from_foo/from1not mis-read as thefromclause);Independent validation
PASS_UNCOMMITTED_F7_REPAIR_CANDIDATE44/44 PASS1723/1723 PASS(26 files)git diff --check: PASSExact identity
24efb0a7b5e553e7e025fed748f65c037f5ddf1395e2ab2fc2b9a373995acb441a593db7b1c397d7test(cockpit): accept comments adjacent to re-export from5AF211E399479F0C2C3E0620965C6D7AA39C31FAF591EA89E9F9C0BEAAFD8F9E4843Explicitly separate finding
CX-1 remains a separate
CURRENT P3finding concerning catastrophic/exponential scanner regex backtracking in the overlapping pre-fromalternatives. It is NOT repaired by this PR and is not implied to be fixed.Authority
This Draft child is quarantine evidence/proposal only. Passing CI or AI review does not authorize integration. PR #58 remains protected and merge-blocked. PR #55 remains Draft and untouched. Human merge authority is preserved.
Summary by CodeRabbit
Bug Fixes
Tests