Enforce braces on control statements with clang-format - #1599
Conversation
Signed-off-by: Guy Ealey Morag <gealeymorag@nvidia.com>
Signed-off-by: Guy Ealey Morag <gealeymorag@nvidia.com>
|
👋 Hi guy-ealey-morag! Thank you for contributing to ai-dynamo/nixl. Your PR reviewers will review your contribution then trigger the CI to test your changes. 🚀 |
|
/build |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughUpdated formatting rules: Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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. Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.clang-format:
- Line 49: Add a short version note explaining the minimum required clang-format
version for the InsertBraces setting so contributors know to use
clang-format-15+; update the repo's .clang-format header (or CONTRIBUTING.md)
with a one-line comment like “Requires clang-format 15+ for InsertBraces” and/or
a CONTRIBUTING.md entry, and ensure the text references the InsertBraces setting
so developers running older clang-format binaries are warned before they format.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 9d50c398-850f-4a96-893f-a36d2f4df80c
📒 Files selected for processing (1)
.clang-format
ColinNV
left a comment
There was a problem hiding this comment.
Very good, now the line
Short if-statements without else can be on single line when appropriate
in docs/CodeStyle.md can be removed.
Signed-off-by: Guy Ealey Morag <gealeymorag@nvidia.com>
b39ceba
|
/build |
What?
Change
clang-formatrules to enforce brackets on control statements (if,else,for,do,while)Why?
This is a repeated issue in NIXL PRs.
With this change CI will fail if any control statement is missing braces (in new and changed code only)
Examples
Summary by CodeRabbit