[cfe-dev] Calling runClangTidy
Manuel Klimek
klimek at google.com
Tue Sep 30 00:43:07 PDT 2014
+alexfh
On Mon Sep 29 2014 at 10:17:47 PM Daniel Dilts <diltsman at gmail.com> wrote:
> I am attempting to directly integrate with clang-tidy. I am attempting to
> call runClangTidy with a set of parameters that, to the best I can tell,
> match what it gets called with when clang-tidy calls it. clang-tidy
> returns 2x ClangTidyError objects, but mine returns none. I would
> appreciate any comments on what I could be doing wrong in the following
> code. I am linking against rev 218612.
>
> std::string error;
> auto db = JSONCompilationDatabase::loadFromBuffer(R"(
> [
> {
> "directory": "D:/llvm",
> "command" : "D:/llvm/build/Debug/bin/clang.exe class_name.cpp",
> "file" : "class_name.cpp"
> }
> ]
> )", error);
> ClangTidyGlobalOptions globalOptions{{}};
> auto options = ClangTidyOptions::getDefaults();
> options.Checks =
> "*,-clang-analyzer-alpha*,-llvm-include-order,-google-*,";
> options.User = "DiltsDa";
> auto optionsProvider =
> llvm::make_unique<DefaultOptionsProvider>(globalOptions, options);
> std::vector<std::string> files{ "class_name.cpp" };
> std::vector<ClangTidyError> errors;
> auto stats = runClangTidy(std::move(optionsProvider), *db, files,
> &errors);
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20140930/d716c80d/attachment.html>
More information about the cfe-dev
mailing list