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

Use clang-format with pre-commit #183

Merged
merged 3 commits into from
Aug 23, 2022
Merged

Use clang-format with pre-commit #183

merged 3 commits into from
Aug 23, 2022

Conversation

flagarde
Copy link
Collaborator

This PR add pre-commit to run clang-format

Issues: #182

@MCWertGaming MCWertGaming self-assigned this Aug 22, 2022
@MCWertGaming
Copy link
Collaborator

We should still check if clang-format was applied using a CI task. Can you add the pre-commit action? @flagarde

@MCWertGaming MCWertGaming self-requested a review August 22, 2022 14:19
Copy link
Collaborator

@MCWertGaming MCWertGaming left a 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.

@MCWertGaming
Copy link
Collaborator

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.

@flagarde
Copy link
Collaborator Author

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

@flagarde
Copy link
Collaborator Author

@MCWertGaming
Copy link
Collaborator

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.

@MCWertGaming
Copy link
Collaborator

Oh, super linter does the same as well. Is the config necessary? Will add a workflow quickly

@flagarde
Copy link
Collaborator Author

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

@flagarde
Copy link
Collaborator Author

you have even this if you want :) https://github.com/oxsecurity/megalinter with pre-commit I think

@flagarde
Copy link
Collaborator Author

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

@MCWertGaming
Copy link
Collaborator

@certik hey, can you approve the request of adding pre-commit to the org? Until then we just use the CI task.

@MCWertGaming MCWertGaming requested a review from certik August 22, 2022 14:48
@MCWertGaming MCWertGaming added the enhancement New feature or request label Aug 22, 2022
@MCWertGaming MCWertGaming added this to the V2.0.0 milestone Aug 22, 2022
@MCWertGaming
Copy link
Collaborator

Automatically applying configuration can break the local branch. I wouldn't recommend that. Also feel free to add more hooks, seems pretty usefull.

@flagarde
Copy link
Collaborator Author

flagarde commented Aug 22, 2022

It doesn't change automatically but it proposes PR for example : yaodaq/YAODAQ#21

@MCWertGaming
Copy link
Collaborator

Yeah, like dependabot.

@MCWertGaming
Copy link
Collaborator

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.

@MCWertGaming MCWertGaming merged commit 57c8bf6 into jupyter-xeus:master Aug 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants