-
Notifications
You must be signed in to change notification settings - Fork 6
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
Pre-commit hook to use clang-format #3
Conversation
Let us try to merge this and see what happens. |
merged |
I'm -1 on having |
I like pre-commit hooks because it kinda ensure that things happened before I commit. But yeah, it is easily bypassed or just ignored. |
I think pre-commit should be a recommendation to reduce CI errors, but we should definitely have a GitHub workflow hook if we want to make sure we are following the formatting guidelines. |
Sounds good! |
Hello! I am proposing to use clang-format as a pre-commit hook.
For this I used the pre-commit micro framework, but I can remove it and use simple 'cp' commands if you think would be better. I also added usage details in the readme.
For this clang-format configuration I used the BasedOnStyle: Google, but it was just to initialize, we can discuss here which style base is better or just create a custom one. There is also a clang-format config detector that analyses the code and create the configurations but it is a windows-based software and I'm not able to try it now.