Skip to content

Commit e30df2d

Browse files
committed
Fix no custom matchers if unspecified config
1 parent 148f945 commit e30df2d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

clang-tools-extra/clang-tidy/ClangTidy.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,13 @@ ClangTidyASTConsumerFactory::createASTConsumer(
425425
if (WorkingDir)
426426
Context.setCurrentBuildDirectory(WorkingDir.get());
427427

428+
for (const auto &[k, v] : Context.getOptions().ClangQueryChecks) {
429+
CheckFactories->registerCheckFactory(k, [v](StringRef Name,
430+
ClangTidyContext *Context) {
431+
return std::make_unique<misc::ClangQueryCheck>(Name, Context, v.Matchers);
432+
});
433+
}
434+
428435
std::vector<std::unique_ptr<ClangTidyCheck>> Checks =
429436
CheckFactories->createChecksForLanguage(&Context);
430437

0 commit comments

Comments
 (0)