-
Notifications
You must be signed in to change notification settings - Fork 915
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 upstream clang-format pre-commit hook. #10659
Use upstream clang-format pre-commit hook. #10659
Conversation
Codecov Report
@@ Coverage Diff @@
## branch-22.06 #10659 +/- ##
================================================
+ Coverage 86.33% 86.36% +0.02%
================================================
Files 140 142 +2
Lines 22289 22352 +63
================================================
+ Hits 19244 19305 +61
- Misses 3045 3047 +2
Continue to review full report at Codecov.
|
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 simplified file type logic should work but I didn't test it. Otherwise, LGTM.
@gpucibot merge |
This PR improves the use of clang-format in pre-commit and CI by using a hook that is managed and cached by pre-commit. Developers who do not use pre-commit will see no changes to their workflow. Developers using pre-commit will be guaranteed that their code is formatted with the pinned version of clang-format (and will always align with CI's style check expectations) even if they have a different version of clang-format (or no version of clang-format) installed on their path. Like all pre-commit hooks for linting CMake and Python code, this version pinning will need to be kept in sync with the conda environment if we choose to upgrade clang-format.
Note: this is aligned with how cuCollections uses clang-format, and it seems that has gone well. Thanks to @PointKernel for testing it on that repo!
https://github.com/NVIDIA/cuCollections/blob/dev/.pre-commit-config.yaml