-
Notifications
You must be signed in to change notification settings - Fork 5
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 CI and linter updates #176
Conversation
…and it doesn't load bashrc thus breaking conda activate
Interestingly some errors that the CI is catching (see https://github.com/nlesc-recruit/cudawrappers/actions/runs/5046918293/jobs/9053071511#step:10:65) |
@bouweandela I fixed most of the linter issues, but I'm stuck on a missing include of the vector_add kernel in the tests. pre-commit doesn't fail on this locally so I'm not sure whats wrong. Could you explain how the cmake stuff that handles the include of cuda code works? If I change
Edit: I just found this which looks like what you did? |
building with -DBUILD_TESTING=True seems to have fixed it, all green now! |
@csbnw there are mostly style changes in this PR, but also a few constructors were made |
Yes, I think the implementation here is based on the answer by 'Martin R' |
What it comes down to is that our pre-commit configuration here: cudawrappers/.pre-commit-config.yaml Lines 6 to 11 in 41f091c
defines how we call the hook defined here: https://github.com/pocc/pre-commit-hooks/blob/336fdd7c3cab698ead0b1c95157b9e74d3906b62/.pre-commit-hooks.yaml#L12-L17 which calls the executable defined here: https://github.com/pocc/pre-commit-hooks/blob/336fdd7c3cab698ead0b1c95157b9e74d3906b62/setup.cfg#L28 which is this Python script: https://github.com/pocc/pre-commit-hooks/blob/master/hooks/clang_tidy.py I suspect the pre-commit hooks will only work correctly if you call them from the root of this repository and you call the build directory |
Thanks, I think something related to the build directory happened indeed because the CI wasn't building the test code but I was doing that locally. So the compilation database was different. In any case it's now passing both locally and on the CI so it should be fixed. |
Looks good to me now! Could you please address the merge conflict? |
Thanks, done! |
Pinning compiler and linter versions in environment.yml and using this conda environment in the pre-commit CI.
Will also fix linter errors. Then this PR closes #172