Skip to content
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

[CI] Add pre-commit hook ClangFormat; format C files with style Google #1631

Merged
merged 2 commits into from
Oct 15, 2024

Conversation

jbampton
Copy link
Member

@jbampton jbampton commented Oct 12, 2024

https://clang.llvm.org/docs/ClangFormat.html

https://clang.llvm.org/docs/ClangFormatStyleOptions.html#basedonstyle

Standardizes the C code to one consistent format.

https://github.com/pre-commit/mirrors-clang-format

https://github.com/ssciwr/clang-format-wheel

Did you read the Contributor Guide?

Is this PR related to a JIRA ticket?

  • No.

What changes were proposed in this PR?

Ran ClangFormat.

How was this patch tested?

From the repo root on Linux I ran:

find python/ -name *.c -o -name *.h | xargs clang-format -i --style=Google

Did this PR include necessary documentation updates?

  • No, this PR does not affect any public API so no need to change the documentation.

@jiayuasu
Copy link
Member

We should add this check to CI. If a commit has files that are not compliant, the CI should fail.

CC @Kontinuation

Copy link
Member

@jiayuasu jiayuasu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should add this check to CI. If a commit has files that are not compliant, the CI should fail.

@jbampton jbampton marked this pull request as draft October 13, 2024 09:19
@github-actions github-actions bot added the root label Oct 13, 2024
@jbampton jbampton changed the title Format C files with ClangFormat style Google [CI] Add pre-commit hook ClangFormat; format C files with style Google Oct 13, 2024
@jbampton jbampton marked this pull request as ready for review October 13, 2024 12:47
@jiayuasu jiayuasu merged commit ec1e26c into apache:master Oct 15, 2024
28 checks passed
@jbampton jbampton deleted the run-default-clang-format branch October 15, 2024 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants