[clang-tools-extra] [clang-tidy] Add UnusedIncludes/MissingIncludes options to misc-include-cleaner (PR #140600)

Baranov Victor via cfe-commits cfe-commits at lists.llvm.org
Tue May 20 06:52:39 PDT 2025


================
@@ -68,12 +70,19 @@ IncludeCleanerCheck::IncludeCleanerCheck(StringRef Name,
       HeaderSuffix += "$";
     IgnoreHeadersRegex.emplace_back(HeaderSuffix);
   }
+
+  if (UnusedIncludes == false && MissingIncludes == false)
+    this->configurationDiag("The check 'misc-include-cleaner' will not "
----------------
vbvictor wrote:

This behavior should be checked in tests (write small file same as `clang-tools-extra/test/clang-tidy/checkers/misc/const-correctness-wrong-config.cpp`)

https://github.com/llvm/llvm-project/pull/140600


More information about the cfe-commits mailing list