manuzhang opened a new pull request, #1078: URL: https://github.com/apache/iceberg-cpp/pull/1078
## What Re-enables clang-tidy's `misc-include-cleaner`, scoped to **standard-library headers only**. ## Why #820 enabled the check unscoped and #708 removed it five days later because it demanded a direct include for every project symbol (`iceberg::Result`, `iceberg::Status`, ...) that an already-included project header provides, which blocked CI with long include lists. Since then nothing checks includes, and review of #1066 found regressions of this shape: `history_table.cc` drops `<vector>` but still uses `std::vector`, and the new `metadata_scan.cc` uses `std::vector`, `std::shared_ptr`, `std::unique_ptr`, `std::string` and `std::make_unique` without `<vector>`, `<memory>` or `<string>`. Both compile only because `metadata_scan.h` happens to include those headers. ## How `misc-include-cleaner.IgnoreHeaders` lists `iceberg/.*` and every third-party header family, so the only diagnostics left are: - a `std::` symbol (or `int64_t`, `size_t`, ...) used without a direct include of its standard header - a standard header that is included but not used With cpp-linter already running clang-tidy 22 on changed lines, this needs no new workflow or tooling. ## Measured on `main` Running the scoped check over every library and test source with the same clang-tidy version CI uses (22.1.8): | Category | Warnings | Files | |---|---|---| | std symbol used without its header | 2271 | 303 | | std header included but unused | 29 | 19 | | project / third-party header (ignored by this config) | 2622 | – | Unscoped, the check would emit all 4922; scoped, the project-header half disappears entirely. The pre-existing standard-library gaps are **not** fixed here. Because `cpp-linter` runs with `--lines-changed-only=true`, they only surface on lines a PR touches, so the codebase converges incrementally and this PR stays a config-only change. A one-shot cleanup with `clang-tidy --fix` is possible as a follow-up if preferred. ## Verified against #1066 Running the new config on that branch reports the missing `<vector>` in `history_table.cc` and the five missing standard headers in `metadata_scan.cc`, and nothing else in those files. One caveat: the `std::vector` use in `history_table.cc` is on a line #1066 did not change, so CI's changed-lines mode would report only the `metadata_scan.cc` findings. Catching include removals whose use sites are untouched would require whole-file linting of changed files, which is a separate decision. 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
