Skip to content

Disable misc-include-cleaner - #274

Merged
helly25 merged 2 commits into
mainfrom
clang_tidy_include_cleaner
Aug 8, 2026
Merged

Disable misc-include-cleaner#274
helly25 merged 2 commits into
mainfrom
clang_tidy_include_cleaner

Conversation

@helly25

@helly25 helly25 commented Aug 8, 2026

Copy link
Copy Markdown
Owner

Fourth clang-tidy triage PR. .clang-tidy only, clearing the largest remaining check: 69 findings across 30 files.

Why

The check demands a direct include for every symbol used, which fights this codebase's umbrella headers.

mbo/types/stringify_test.cc includes exactly one project header, mbo/types/stringify.h, and then uses the concepts that header exists to expose:

using ::mbo::types::types_internal::kStructNameSupport;
using ::mbo::types::types_internal::SupportsFieldNames;
using ::mbo::types::types_internal::SupportsFieldNamesConstexpr;

The check asks it to include mbo/types/internal/struct_names.h directly instead. Satisfying that would have tests reaching past the public header into an internal one — deepening precisely the coupling the umbrella header was written to avoid. Same shape in json_test.cc (mbo::types::ThreeWayComparableTo, which lives in traits.h).

On the concepts issue

The check is also reported to mishandle concepts, with uses inside requires clauses going unattributed. I have recorded that in .clang-tidy as a known issue rather than something reproduced here — every finding I inspected was a genuine "no direct include" report, including traits_test.cc being flagged for std::same_as when it really does not include <concepts>.

So the umbrella-header conflict is the operative reason, and the rationale in the config says so rather than overclaiming a tool bug. If include hygiene is wanted later, IWYU proper is the better tool for it.

Test

  • The check reports zero on previously affected files (stringify.cc, json_test.cc, demangle.cc).
  • The other 26 misc-* checks stay enabled — this disables one check, not the group.
  • clang-tidy --verify-config clean, so the name is not a typo silently doing nothing.
  • pre-commit run -a green.

helly25 and others added 2 commits August 8, 2026 20:10
The check demands a direct include for every symbol used, which fights
this codebase's umbrella headers: mbo/types/stringify_test.cc includes
`stringify.h` and uses the concepts that header exists to expose
(SupportsFieldNames, kStructNameSupport), and the check asks it to reach
past the public header into `internal/struct_names.h` instead. Satisfying
it would deepen exactly the coupling the umbrella header was written to
avoid. Same shape in json_test.cc (ThreeWayComparableTo from traits.h).

69 findings across 30 files, the largest remaining check.

The check is also reported to mishandle concepts, with uses inside
`requires` clauses going unattributed. That is recorded as a known issue
rather than something reproduced here: the samples inspected were all
genuine "no direct include" reports, so the umbrella-header conflict is
the operative reason. If include hygiene is wanted later, IWYU proper is
the better tool for it.

Verified: the check reports zero on the previously affected files, the
other 26 misc-* checks stay enabled, and --verify-config is clean.

Signed-off-by: helly25 <6420169+helly25@users.noreply.github.com>
@helly25
helly25 enabled auto-merge (squash) August 8, 2026 19:22
@helly25
helly25 requested a review from Fab-Cat August 8, 2026 19:22
@helly25
helly25 merged commit 62c4f0a into main Aug 8, 2026
23 checks passed
@helly25
helly25 deleted the clang_tidy_include_cleaner branch August 8, 2026 20:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants