forked from qt-creator/qt-creator
ClangTools: Add tool that runs clang-tidy and clazy
... over the whole project. Generate and read serialized files to get diagnostics. Change-Id: Iafc25fc70443107a040a995efc038aed35102bbf Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
This commit is contained in:
@@ -94,6 +94,19 @@ void ClangDiagnosticConfig::setClangTidyMode(TidyMode mode)
|
||||
m_clangTidyMode = mode;
|
||||
}
|
||||
|
||||
QString ClangDiagnosticConfig::clangTidyChecks() const
|
||||
{
|
||||
QString checks;
|
||||
if (m_clangTidyMode == TidyMode::ChecksPrefixList) {
|
||||
checks = QStringLiteral("-*") + clangTidyChecksPrefixes();
|
||||
} else if (m_clangTidyMode == TidyMode::ChecksString) {
|
||||
checks = clangTidyChecksString();
|
||||
checks = checks.simplified();
|
||||
checks.replace(" ", "");
|
||||
}
|
||||
return checks;
|
||||
}
|
||||
|
||||
QString ClangDiagnosticConfig::clangTidyChecksPrefixes() const
|
||||
{
|
||||
return m_clangTidyChecksPrefixes;
|
||||
|
||||
@@ -54,6 +54,8 @@ public:
|
||||
QStringList clangOptions() const;
|
||||
void setClangOptions(const QStringList &options);
|
||||
|
||||
QString clangTidyChecks() const;
|
||||
|
||||
QString clangTidyChecksPrefixes() const;
|
||||
void setClangTidyChecksPrefixes(const QString &checks);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user