From 651c23b5a06799e15fa31bedc84462119720e710 Mon Sep 17 00:00:00 2001 From: helly25 <6420169+helly25@users.noreply.github.com> Date: Sat, 8 Aug 2026 20:10:15 +0100 Subject: [PATCH] Disable misc-include-cleaner 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> --- .clang-tidy | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.clang-tidy b/.clang-tidy index 0646e861..214cadf9 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -14,6 +14,16 @@ # Bounds safety here is a matter for tests, sanitizers (--config=asan) and review. # Re-enabling any of them means auditing its findings, not just flipping the flag. # +# misc-include-cleaner is off. It demands a direct include for every symbol used, +# which fights this codebase's umbrella headers: a test includes `stringify.h` and +# uses the concepts that header exists to expose, and the check asks it to reach +# past the public header into `internal/struct_names.h` instead - deepening the +# coupling the umbrella header was written to avoid. That accounted for 69 +# findings across 30 files. The check is also reported to mishandle concepts +# (uses inside `requires` clauses going unattributed); that is a known issue and +# not something verified here, so the umbrella-header conflict is the operative +# reason. If the include hygiene is ever wanted, IWYU proper is the better tool. +# # abseil-unchecked-statusor-access is off because clang-tidy 22.1.8 SEGFAULTS in # it: its dataflow analysis (runTypeErasedDataflowAnalysis) crashes on # mbo/strings/strip.cc, reproducibly on both macOS and Linux. Re-test on a future @@ -58,6 +68,7 @@ Checks: > -llvm-prefer-static-over-anonymous-namespace, -llvmlibc-*, misc-*, + -misc-include-cleaner, modernize-*, -modernize-use-nodiscard, -modernize-use-std-format,