[clang-tools-extra] [clang-tidy] Add filtering of check options by enabled checks in '--dump-config' (PR #147142)
Julian Schmidt via cfe-commits
cfe-commits at lists.llvm.org
Sat Jul 12 15:12:38 PDT 2025
================
@@ -503,6 +503,21 @@ getCheckNames(const ClangTidyOptions &Options,
return Factory.getCheckNames();
}
+void filterCheckOptions(ClangTidyOptions &Options,
+ const std::vector<std::string> &EnabledChecks) {
+ StringSet<> EnabledChecksSet(llvm::from_range, EnabledChecks);
----------------
5chmidti wrote:
Instead of creating a set, technically it's already [sorted](https://github.com/llvm/llvm-project/blob/main/clang-tools-extra/clang-tidy/ClangTidy.cpp#L484), but for clarity, and not to depend on something implicit, we could change the `vector<string>` to be a `StringSet` from the [start](https://github.com/llvm/llvm-project/blob/main/clang-tools-extra/clang-tidy/ClangTidy.cpp#L470). (Didn't check all dependencies on this value yet)
https://github.com/llvm/llvm-project/pull/147142
More information about the cfe-commits
mailing list