-
Notifications
You must be signed in to change notification settings - Fork 924
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
Add clang-tidy to CI #16958
Add clang-tidy to CI #16958
Conversation
8d4d334
to
308bc0e
Compare
308bc0e
to
953659c
Compare
Now that CI is passing here, have a number of questions that need to be addressed about how we want clang-tidy to work.
P.S. the run-clang-tidy.py script that was already present before this PR was pretty buggy and had numerous issues, so I've opted to bypass it for now. The main feature it could offer is the ability to run clang-tidy on cu files, but that has been disabled for a long time anyway so I haven't bothered to try and enable it with the hook either. I've left the file in with the expectation that we could use it to make iterative improvements to our process and hopefully add that kind of coverage in as well eventually. P.P.S. the cugraph-ops repo has an improved version of the above script that works better in some cases, but it has many warts of its own that we have struggled with in the past. I would prefer to constructively build up something that we can maintain well going forward rather than try to figure that version out from its current state. |
I definitely don't want to run |
See https://gitlab.kitware.com/cmake/cmake/-/jobs/10338803 for an example of how CMake handles running |
|
Based off some offline discussion, we're going to move from a pre-commit hook to invoking clang-tidy via CMake and then run it on all files in a nightly job. I'll update this PR accordingly. |
Some notes for reviewers:
|
Co-authored-by: Kyle Edwards <[email protected]>
Folks using an IDE that supports clang-tidy can see clang-tidy issues in real-time as you edit, BTW. So you don't have to wait for the nightly to fail. We should encourage this to avoid committing breaking changes. |
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.
All seems fine to me. Reminder to move the job to nightlies!
Done! Thanks for the review. |
/merge |
Description
This PR adds clang-tidy checks to our CI. clang-tidy will be run in nightly CI via CMake. For now, only the parts of the code base that were already made compliant in the PRs leading up to this have been enabled, namely cudf source and test cpp files. Over time we can add more files like benchmarks and examples, add or subtract more rules, or enable linting of cu files (see https://gitlab.kitware.com/cmake/cmake/-/issues/25399). This PR is intended to be the starting point enabling systematic linting, at which point everything else should be significantly easier.
Resolves #584
Checklist