-
Notifications
You must be signed in to change notification settings - Fork 56
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
Use clang-format with pre-commit #183
Use clang-format with pre-commit #183
Conversation
We should still check if clang-format was applied using a CI task. Can you add the pre-commit action? @flagarde |
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 linting must be checked by the CI.
In other projects I'm using this https://github.com/github/super-linter. If pre-commit applies more than just clang-format, we might want to add a pre-commit specific CI task instead. |
You can ask https://pre-commit.ci/ to run pre-commit on PR et push... I t should even resubmit the change back on the PR |
Does pre-commit have any benefits over just applying clang-format? Super linter by github also tests for git leaks and other things additionally to linting the source code. |
Oh, super linter does the same as well. Is the config necessary? Will add a workflow quickly |
Yes pre-commit can run many tools on CI and on computer https://github.com/yaodaq/YAODAQ/blob/main/.pre-commit-config.yaml etc .. You can even create yours |
you have even this if you want :) https://github.com/oxsecurity/megalinter with pre-commit I think |
Normally you even don't need the CI if the tools are installed inside the https://pre-commit.ci/ . You just have to give access to the app to the repo.. There is also auto PR for upgrade of the hooks. You need only a CI if the tools can't be installed by the hooks or are not present in pre-commit.ci |
@certik hey, can you approve the request of adding pre-commit to the org? Until then we just use the CI task. |
Automatically applying configuration can break the local branch. I wouldn't recommend that. Also feel free to add more hooks, seems pretty usefull. |
It doesn't change automatically but it proposes PR for example : yaodaq/YAODAQ#21 |
Yeah, like dependabot. |
Sadly I don't have high enough permissions on the organization to set up the pre-commit bot. So I'll merge this for now and look into reaching out to certik. |
This PR add pre-commit to run clang-format
Issues: #182