build: enable clang-tidy misc-include-cleaner for include hygiene#820
Open
yadavay-amzn wants to merge 1 commit into
Open
build: enable clang-tidy misc-include-cleaner for include hygiene#820yadavay-amzn wants to merge 1 commit into
yadavay-amzn wants to merge 1 commit into
Conversation
Collaborator
|
Not too sure, but should we pursue LLVM include-cleaner [1]? [1] https://clang.llvm.org/extra/clang-tidy/checks/misc/include-cleaner.html |
Author
|
Good suggestion - pivoted to misc-include-cleaner. Since the project already runs clang-tidy 22 incrementally via cpp-linter, this enforces include hygiene on changed lines with no new tooling, so I dropped the separate IWYU workflow, iwyu.imp mapping, and CMake option. Added misc-include-cleaner.IgnoreHeaders for the vendored third-party headers (arrow, nanoarrow, nlohmann, spdlog, CRoaring, cpr) to suppress noise. The diff is now just a few lines in .clang-tidy. Updated the PR title/description accordingly. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Closes #73. Enables clang-tidy's
misc-include-cleanercheck to enforce include hygiene.How
Adds
misc-include-cleanerto.clang-tidy. Because the project already runs clang-tidy 22 incrementally (changed-lines-only) via the cpp-linter workflow, include hygiene is now enforced on new/changed code with no additional tooling, workflow, or mapping file.IgnoreHeadersis configured for third-party headers (arrow, nanoarrow, nlohmann-json, spdlog, CRoaring, cpr) to suppress noise from vendored includes.Notes
This supersedes the original IWYU-based approach (a separate workflow +
iwyu.impmapping + CMake option), per the review discussion with @zhjwpku:misc-include-cleanerintegrates with the existing clang-tidy setup and is far lower-maintenance for the same goal.This contribution was authored with assistance from Claude Opus 4.8, in line with the Iceberg guidelines for AI-assisted contributions (https://iceberg.apache.org/contribute/#guidelines-for-ai-assisted-contributions). All changes were reviewed and tested by the author.