Index: clang-tools-extra/trunk/clang-tidy/ClangTidyOptions.cpp =================================================================== --- clang-tools-extra/trunk/clang-tidy/ClangTidyOptions.cpp +++ clang-tools-extra/trunk/clang-tidy/ClangTidyOptions.cpp @@ -218,15 +218,6 @@ std::vector FileOptionsProvider::getRawOptions(StringRef FileName) { DEBUG(llvm::dbgs() << "Getting options for file " << FileName << "...\n"); - SmallString<256> FilePath(FileName); - - if (std::error_code EC = llvm::sys::fs::make_absolute(FilePath)) { - llvm::errs() << "Can't make absolute path from " << FileName << ": " - << EC.message() << "\n"; - // FIXME: Figure out what to do. - } else { - FileName = FilePath; - } std::vector RawOptions = DefaultOptionsProvider::getRawOptions(FileName); Index: clang-tools-extra/trunk/clang-tidy/tool/ClangTidyMain.cpp =================================================================== --- clang-tools-extra/trunk/clang-tidy/tool/ClangTidyMain.cpp +++ clang-tools-extra/trunk/clang-tidy/tool/ClangTidyMain.cpp @@ -313,13 +313,19 @@ if (!PathList.empty()) { FileName = PathList.front(); } - ClangTidyOptions EffectiveOptions = OptionsProvider->getOptions(FileName); + + SmallString<256> FilePath(FileName); + if (std::error_code EC = llvm::sys::fs::make_absolute(FilePath)) { + llvm::errs() << "Can't make absolute path from " << FileName << ": " + << EC.message() << "\n"; + } + ClangTidyOptions EffectiveOptions = OptionsProvider->getOptions(FilePath); std::vector EnabledChecks = getCheckNames(EffectiveOptions); if (ExplainConfig) { //FIXME: Show other ClangTidyOptions' fields, like ExtraArg. std::vector - RawOptions = OptionsProvider->getRawOptions(FileName); + RawOptions = OptionsProvider->getRawOptions(FilePath); for (const std::string &Check : EnabledChecks) { for (auto It = RawOptions.rbegin(); It != RawOptions.rend(); ++It) { if (It->first.Checks && GlobList(*It->first.Checks).contains(Check)) { Index: clang-tools-extra/trunk/test/clang-tidy/list-checks.cpp =================================================================== --- clang-tools-extra/trunk/test/clang-tidy/list-checks.cpp +++ clang-tools-extra/trunk/test/clang-tidy/list-checks.cpp @@ -0,0 +1,5 @@ +// REQUIRES: shell +// RUN: mkdir -p %T/clang-tidy/list-checks/ +// RUN: echo '{Checks: "-*,google-*"}' > %T/clang-tidy/.clang-tidy +// RUN: cd %T/clang-tidy/list-checks +// RUN: clang-tidy -list-checks | grep "^ *google-"