fix: handle operators after brace initialization - #474
walidbi200 wants to merge 1 commit into
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthroughThe brace-spacing check now suppresses false positives for nested brace initialization followed by operators. Tests cover arithmetic, comparison, bitwise, shift, and logical operators, plus ChangesBrace spacing false-positive fix
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix · Severity of issue fixed: Low Suggested reviewers: Merge Risk: ⚪ Minimal · up to The brace-spacing rule avoids the reported false positives while preserving relevant diagnostics, and the supplied regression coverage supports merging. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 2 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches🧪 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 |
Fixes #373.
The brace-spacing check already recognizes several contexts where
{}is initialization rather than a block, but it can misclassify a nested braced value when its closing brace is followed by an operator.For example:
This currently reports
whitespace/bracesonpmr_string{a}.This change recognizes operator continuation after a braced value while preserving block-spacing diagnostics such as malformed
requires(T t){ ... }and lambda bodies.Regression coverage includes the original #373 shape, nested braced values followed by arithmetic, bitwise, comparison, shift, and logical operators, plus negative controls for block braces.
Validation:
git diff --check: passed