[clang-tools-extra] [clang-tidy] Add `IgnoredFilesList` option to `readability-duplicate-include` (PR #168196)

Baranov Victor via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 19 04:58:35 PST 2025


================
@@ -62,10 +61,32 @@ class DuplicateIncludeCallbacks : public PPCallbacks {
   SmallVector<FileList> Files;
   DuplicateIncludeCheck &Check;
   const SourceManager &SM;
+  SmallVector<llvm::Regex> AllowedRegexes;
 };
 
 } // namespace
 
+DuplicateIncludeCheck::DuplicateIncludeCheck(StringRef Name,
+                                             ClangTidyContext *Context)
+    : ClangTidyCheck(Name, Context),
+      IgnoredFilesList(
+          llvm::ArrayRef<llvm::StringRef>(utils::options::parseStringList(
----------------
vbvictor wrote:

`llvm::ArrayRef<llvm::StringRef>()` looks odd, I think we usually use `utils::options::parseStringList` without any casting. I guess that `parseList` returns `std::vector` thus we need it.
Despite @zwuis comment, I think we should use `std::vector` in options and later create an overload for `utils::options::parseStringList` to return `llvm::SmallVector`.

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


More information about the cfe-commits mailing list