-
Notifications
You must be signed in to change notification settings - Fork 227
Setup clang format for C code #2437
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
Conversation
1433d21 to
92f5cbc
Compare
58585d3 to
44781eb
Compare
44781eb to
334cd97
Compare
ac540b3 to
f06867e
Compare
|
I'm good for clang-format. Can you add a commit for 4-space indentation? |
|
Updated the indent width to 4 👍 |
0543ef3 to
13f9dc3
Compare
2cd788d to
8a7cb1b
Compare
8a7cb1b to
013584a
Compare
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y libdb-dev curl autoconf automake m4 libtool python3 | ||
| - name: Install Re2c |
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.
@soutaro I decided to move all checking related tasks to the new c-check workflow so we can simplify the ruby builds too. WDYT?
| @@ -0,0 +1,74 @@ | |||
| --- | |||
| Language: Cpp | |||
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.
We have to explicitly list many rules here to reduce/avoid differences between clang-format versions, which is hard to enforce across dev machines and CI.
|
@soutaro I think it's ready for review |
soutaro
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.
Thanks!
|
Updated the branch protection setting to require |
Setup clang format for C code
| bundler-cache: none | ||
| - name: Set working directory as safe | ||
| run: git config --global --add safe.directory $(pwd) | ||
| - name: Set up permission |
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.
This step causes an error...
(Other jobs are fixed in #2485.)
|
Merged this PR to continue working on other PRs. |
While working on #2398, we found it necessary to have some sort of auto-formatting for C code as well to ensure consistent coding style. But instead of adding it as part of #2398, which already introduces many changes on the implementation itself, I think it'd be better to have the auto-formatting setup in a separate PR.
This PR:
clang-formatfor the project, including.clang-formatdefines the rules of formatting (likerubocop.yml)format:crake task will perform the formatting to all C code underext/,src/, andinclude/format:c_checkrake task will check if formatting is required without actually making the changesformat:c_check