-
Notifications
You must be signed in to change notification settings - Fork 920
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
Enable linting of CMake files using pre-commit #9484
Enable linting of CMake files using pre-commit #9484
Conversation
…gs gracefully for both cmake-format and cmake-lint.
… the config is not present, and exits with failure if the linters run and fail.
Codecov Report
@@ Coverage Diff @@
## branch-21.12 #9484 +/- ##
================================================
- Coverage 10.79% 10.66% -0.13%
================================================
Files 116 117 +1
Lines 18869 19726 +857
================================================
+ Hits 2036 2104 +68
- Misses 16833 17622 +789
Continue to review full report at Codecov.
|
@robertmaynard I think this should be good to go now. |
rerun tests |
@gpucibot merge |
This PR resolves #9396, making it easy to run
cmake-format
andcmake-lint
on CMake files in cudf using pre-commit. The one additional complexity associated with these hooks compared to our other pre-commit hooks is the need for thecmake-format-rapids-cmake.json
configuration file that is maintained in rapids-cmake and is only added during the build process. We don't want pre-commit to fail outright when the file isn't present, so this PR introduces a custom script wrapping thecmake-format
andcmake-lint
hooks in a check for the presence of the file. The script respects an associated environment variable that advanced users can exploit if they store this file in a nonstandard location.Once this PR is finalized I'll make a follow-up PR that actually applies the formatting to our existing CMake.