-
Notifications
You must be signed in to change notification settings - Fork 131
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
Format code using clang format and introduce CI checks for it #103
Conversation
Instantiate the code formating make rule. Also delete the original .clang-format file because this configuration is out-of-date and the ci repo provides an updated one. Signed-off-by: Jose Martins <[email protected]>
This commits also adds a status badge in the README.md file for the overall code quality workflow which is intended to have additional static code analysis checks in the future. Signed-off-by: Jose Martins <[email protected]>
1318d66
to
4efe0b9
Compare
c3ebbb0
to
426baad
Compare
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.
In the overall, I agree with clang format options that we are using. I tried to keep my eyes wide open to check for inconsistencies on the formatted files, but for sure we need to run this in all boards.
Regarding the clang options:
- SpaceBeforeParensOptions: My a personal taste, I wouldn't use the space before control statements if we are not using it for functions
- AlignTrailingComments: this options also controls the comments in structs right? If so, I would force it. In large structs keeping the comments unaligned does not help the readability of each member of the struct.
Signed-off-by: Jose Martins <[email protected]>
426baad
to
5c882bd
Compare
I'm thinking we could define a max of 100 columns instead of 80. This is kind of being stuck in the past... Modern monitors are wide enough that this does not become an hassle. |
I totally agree with this. Other projects already follow the 100 columns too. |
5c882bd
to
a2c0176
Compare
Updated to use a 100 char column limit. |
If no one has further comments, I bumping this to full PR. |
We need to first merge bao-project/bao-ci#70, then update the ci submodule here, and only then can we merge this. |
Signed-off-by: Jose Martins <[email protected]>
Signed-off-by: Jose Martins <[email protected]>
Signed-off-by: Jose Martins <[email protected]>
Signed-off-by: Jose Martins <[email protected]>
a2c0176
to
13e7b8f
Compare
Signed-off-by: Jose Martins <[email protected]>
Signed-off-by: Jose Martins <[email protected]>
13e7b8f
to
49d41a3
Compare
Updated CI submodule. |
59fecb5
to
9934d08
Compare
Signed-off-by: Daniel Oliveira <[email protected]> Signed-off-by: Jose Martins <[email protected]>
9934d08
to
88dd4f0
Compare
This PR is initially marked as a draft to achieve consensus on the formatting rules defined in the bao-project/bao-ci .clang_format file. I'd ask the @bao-project/core-team to scan the code base and to provide feedback in this sense if they don't agree with any specific previously discussed format decisions so we can discuss further and update the clang-format options accordingly.
Temporarily the ci branch is set to bao-project/bao-ci's exp/clang-format-options branch so that we can play around with the CI options before merging them into bao-project/bao-ci 's main accordingly and set the submodule in this PR to it.
Depends on bao-project/bao-ci#70.