- 
                Notifications
    You must be signed in to change notification settings 
- Fork 722
Added clang-format rule to insert braces for multiline control blocks. #1990
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
…le` statements.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR applies clang-format rules to add braces for multiline control blocks, improving code readability and consistency. The changes enforce the coding standard that any multiline control flow statements should have their bodies enclosed in braces.
- Adds braces around single-line control blocks in if/else/while/for statements
- Maintains code functionality while improving formatting consistency
- Applies across multiple test and source files to establish uniform code style
Reviewed Changes
Copilot reviewed 143 out of 143 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description | 
|---|---|
| Tests/Pcap++Test/main.cpp | Added braces for multiline if statements in configuration setup | 
| Tests/Pcap++Test/Tests/*.cpp | Added braces for control blocks in test files across various protocol implementations | 
| Tests/Packet++Test/main.cpp | Added braces for configuration if statements | 
| Tests/Packet++Test/Utils/TestUtils.cpp | Added braces for control flow statements in utility functions | 
| Tests/Fuzzers/*.cpp | Added braces for conditional statements in fuzzing test code | 
| Pcap++/src/*.cpp | Added braces for control blocks in networking device implementation files | 
| Packet++/src/*.cpp | Added braces for control blocks in packet parsing and protocol layer implementations | 
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| Codecov Report❌ Patch coverage is  
 Additional details and impacted files@@            Coverage Diff             @@
##              dev    #1990      +/-   ##
==========================================
- Coverage   83.43%   83.38%   -0.05%     
==========================================
  Files         311      311              
  Lines       54989    55273     +284     
  Branches    12084    12065      -19     
==========================================
+ Hits        45879    46091     +212     
- Misses       7845     8310     +465     
+ Partials     1265      872     -393     
 Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
 | 
# Conflicts: # Packet++/src/Packet.cpp
| The CI error is unrelated to the PR. It is because clang tidy can't find a header in FuzzTarget.cpp for some reason. | 
| @Dimi1010 this PR has 143 files and ~3200 lines changed. It's very hard to review... what do you suggest? | 
| 
 Tbf, not much can be done... We can split it into multiple and have the change to clang-format config added last. That would still mean reviewing everything but potentially in smaller sections? Maybe 10~15 files a batch. Most of the chages are trivial "add line + {" or "add line + }". | 
| Alternatively, I suppose github UI has a "viewed" checkmark on a file to support marking off which files have already been seen when doing a long review so it can be done in several sessions. | 
| @Dimi1010 going over all changes will take quite a long time (and it's also quite boring 🙈 ). I can do it if we don't have a better option... | 
| 
 I know... I don't really have better ideas at the moment, though. Formatting chages are always a pain... sigh. That is why I ran the copilot review on it. I suppose we can trust that. (Famous last words) | 
| @seladb Btw, any idea why clang-tidy doesn't see the pcpp headers in the Fuzzer? | 
| 
 I have no idea... it shouldn't be related to this PR, but it usually passes so maybe it is related to these changes somehow? | 
| 
 Ok, I guess I'll review it... it might take some time though... first let's make sure the CI passes? | 
Application of #1962 (comment)