Skip to content

Commit c05ed3d

Browse files
committed
Return error code in ExplainConfig path
1 parent e8d6c28 commit c05ed3d

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -639,14 +639,15 @@ int clangTidyMain(int argc, const char **argv) {
639639
std::vector<clang::tidy::ClangTidyOptionsProvider::OptionsSource>>
640640
RawOptions = OptionsProvider->getRawOptions(FilePath);
641641

642-
if (RawOptions) {
643-
for (const std::string &Check : EnabledChecks) {
644-
for (const auto &[Opts, Source] : llvm::reverse(*RawOptions)) {
645-
if (Opts.Checks && GlobList(*Opts.Checks).contains(Check)) {
646-
llvm::outs() << "'" << Check << "' is enabled in the " << Source
647-
<< ".\n";
648-
break;
649-
}
642+
if (!RawOptions)
643+
return 1;
644+
645+
for (const std::string &Check : EnabledChecks) {
646+
for (const auto &[Opts, Source] : llvm::reverse(*RawOptions)) {
647+
if (Opts.Checks && GlobList(*Opts.Checks).contains(Check)) {
648+
llvm::outs() << "'" << Check << "' is enabled in the " << Source
649+
<< ".\n";
650+
break;
650651
}
651652
}
652653
}

0 commit comments

Comments
 (0)