-
Notifications
You must be signed in to change notification settings - Fork 908
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 IWYU to CI #17078
Add IWYU to CI #17078
Conversation
b8e68c6
to
8f1fc50
Compare
This PR cherry-picks out the suggestions from IWYU generated in #17078. Authors: - Vyas Ramasubramani (https://github.com/vyasr) Approvers: - Bradley Dice (https://github.com/bdice) - David Wendt (https://github.com/davidwendt) URL: #17170
461228a
to
d9384f6
Compare
function(enable_clang_tidy target) | ||
set(_tidy_options) | ||
function(enable_static_checkers target) | ||
set(_tidy_options IWYU CLANG_TIDY) |
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.
Do we need these options, or should we just always enable all linters?
This reverts commit 8b7a356.
In addition to the inline notes above, there are a couple other points that I anticipate coming up from reviewers:
I'll leave it to reviewers to determine what to gate this PR on vs. doing in follow-ups. |
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.
Looks great. Couple of comments.
OK this was bothering me so I went ahead and updated the script to filter live rather than do a batch process at the end, which should make parsing the CI output much easier. |
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.
Giving you a ci-codeowners
/ packaging-codeowners
approval. Left one very very tiny suggestion, do whatever you want with it.
Co-authored-by: James Lamb <[email protected]>
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.
I tried IWYU years ago. But it was not suitable because of too many changes it suggested.
Good approach to "only include removals". 👍
Including "tests" would be nice because often some includes are not cleaned up after development/debug.
/merge |
Description
This PR adds
include-what-you-use
to the CI job running clang-tidy. Like clang-tidy, IWYU runs via CMake integration and only runs on cpp files, not cu files. This should help us shrink binaries and reduce compilation times in cases where headers are being included unnecessarily, and it helps keep our include lists clean. The IWYU suggestions for additions are quite noisy and the team determined this to be unnecessary, so this PR instead post-filters the outputs to only show the removals. The final suggestions are uploaded to a file that is uploaded to the GHA page so that it can be downloaded, inspected, and easily applied locally.Resolves #581.
Checklist