-
Notifications
You must be signed in to change notification settings - Fork 37
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 pre-built hooks in pre commit #402
base: main
Are you sure you want to change the base?
Conversation
Hi, I think we have local hooks on purpose as there was a preference in key4hep repos to get the dependencies from cvmfs rather than pip when possible. |
@m-fila I see the point. The benefit of using pre-commit to install hooks is that the setup on a local machine is ~ trivial, as you don't have to install anything beyond pre-commit. To that point, ruff already comes from pip, and you'll probablly be getting pre-commit from pip also, so I don't see a huge benefit of taking clang-format from cvmfs. But it's your call in the end, of course. |
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.
As @m-fila has already said. The original idea behind running this on top of the Key4hep environment was that people were a bit less likely to run into potential issues, specifically around clang-format
that sometimes changes its opinions on formatting for different versions. If we switch to pre-packaged hooks, we open the door for version mismatches and a bit more maintenance burden. On the other hand, I see the benefits of being able to run this without having the complete environment (especially for EDM4hep).
@tmadlener I would argue that you completely remove the possibility of version mismatches, because pre-commit will always install and use exactly the correct clang-format version. As long as the format check is run with pre-commit (which it already is), there should be no need to match versions. |
pre-commit will, but other tools that pick up clang-tooling from elsewhere might not, so there is a chance that the auto-format hook of editors / IDEs disgaree with what is done in pre-commit. But presumably the |
This PR updates pre-commit to
python XXX
topython3 XXX
, as this is the default name of the python binary on most (all?) systems nowadays.I tried to update the CI config to correctly run this, but let's see.
BEGINRELEASENOTES
ENDRELEASENOTES