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

[Tools] Add a git commit hook for clang-format checking #2301

Closed
1 of 2 tasks
mapleFU opened this issue May 7, 2024 · 4 comments · Fixed by #2359
Closed
1 of 2 tasks

[Tools] Add a git commit hook for clang-format checking #2301

mapleFU opened this issue May 7, 2024 · 4 comments · Fixed by #2359
Labels
A-build area build enhancement type enhancement good first issue Good for newcomers

Comments

@mapleFU
Copy link
Member

mapleFU commented May 7, 2024

Search before asking

  • I had searched in the issues and found no similar issues.

Motivation

Currently our ci checks clang-format. We can add a checking in git hook for that.

Solution

Aadd a checking in git hook for format

Are you willing to submit a PR?

  • I'm willing to submit a PR!
@JoverZhang
Copy link
Contributor

I guess we could hard link pre-push.sh to .git/hooks/pre-push during x.py build.

For example:

https://github.com/rust-lang/rust/blob/faefc618cf48bd794cbc808448df1bf3f59f36af/src/bootstrap/src/core/build_steps/setup.rs#L511-L522

However, I'm unsure about the directory in the project where the pre-push.sh source code should be placed.

@PokIsemaine
Copy link
Contributor

PokIsemaine commented May 8, 2024

If convenient, you can add other checks at the same time, such as golang format, clang tidy

@mapleFU
Copy link
Member Author

mapleFU commented May 11, 2024

However, I'm unsure about the directory in the project where the pre-push.sh source code should be placed.

At root or some build scripts might be ok

clang tidy

clang-tidy is time-consuming, I guess puting it at ci or by-user is better

@PokIsemaine
Copy link
Contributor

/assign

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-build area build enhancement type enhancement good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants