MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / clangTidyCmd

Method clangTidyCmd

gui/checkthread.cpp:477–500  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

475}
476
477QString CheckThread::clangTidyCmd()
478{
479 QString path = QSettings().value(SETTINGS_CLANG_PATH,QString()).toString();
480 if (!path.isEmpty())
481 path += '/';
482 path += "clang-tidy";
483#ifdef Q_OS_WIN
484 path += ".exe";
485#endif
486
487 QProcess process;
488 process.start(path, QStringList() << "--version");
489 process.waitForFinished();
490 if (process.exitCode() == 0)
491 return path;
492
493#ifdef Q_OS_WIN
494 // Try to autodetect clang-tidy
495 if (QFileInfo("C:/Program Files/LLVM/bin/clang-tidy.exe").exists())
496 return "C:/Program Files/LLVM/bin/clang-tidy.exe";
497#endif
498
499 return QString();
500}
501

Callers

nothing calls this directly

Calls 6

isEmptyMethod · 0.80
QSettingsClass · 0.70
QStringClass · 0.70
toStringMethod · 0.45
valueMethod · 0.45
existsMethod · 0.45

Tested by

no test coverage detected