-
Notifications
You must be signed in to change notification settings - Fork 51
Enforce code formatting in PR #1342
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: master
Are you sure you want to change the base?
Conversation
2f07360 to
e795760
Compare
39d5133 to
d70bcef
Compare
ihsandemir
left a comment
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 example runs shared, the printed error message is not informative enough. It says
./hazelcast/test/src/sql_test.cpp:1795:33: error: code should be clang-formatted [-Wclang-format-violations]
auto statement = [&result](){
^
But what is the actual problem with that line? Is there a way also print details?
ihsandemir
left a comment
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.
the shared example success actually has a failed step code coverage?
The code coverage is already failing (or at least, flakey) - https://github.com/hazelcast/hazelcast-cpp-client/actions/runs/19500936469/job/55814670258 |
This is all the information the tool offers. It's just a wrapper around It does raise a summary that shows what files have formatting errors. We already tell contributors to format the code - this is just a test to assert they have: hazelcast-cpp-client/.github/CONTRIBUTING.md Lines 7 to 8 in 6d47098
|
| ref: ${{ needs.get-refs.outputs.ref }} | ||
| token: ${{ secrets.GH_TOKEN }} | ||
|
|
||
| - uses: jidicula/clang-format-action@6cd220de46c89139a0365edae93eee8eb30ca8fe # v4.16.0 |
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.
is this action a secure reliable code base?
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.
is this action a secure reliable code base?
I think so, and it's used by many others.
Did you consider using: This seems to show better about what to be changed and it works on only the changed files compared to master. |
There are a couple with this approach (although yes, the output is nicer):
I think the net result of both approaches is the same. |
In #946 the codebase was reformatted for consistency, but as this was not enforced the codebase has drifted since then.
To avoid this happening again, enforce this at the PR stage.
Testing:
Post-merge: