Clang: Use the tree instead of the list for Clang-Tidy settings

List of checks does not give enough flexibility to
select/unselect specific checks. The tree fixes that.

Also remove Clang-Tidy checks line edit because it is
now integrated into the tree mode as an alternative way
of providing checks by pressing "Plain text edit" button.

'cpptools_clangtidychecks.h' is generated using python
script 'generateClangTidyChecks.py' and clang-tidy
from our LLVM/Clang 6.0 build.

Change-Id: I2ed1738cb2cbbf8dac6aba563469f06f69b11593
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
This commit is contained in:
Ivan Donchevskii
2018-05-16 07:58:53 +02:00
parent b1fcbfecce
commit bc458c7b5f
13 changed files with 1085 additions and 209 deletions

View File

@@ -73,8 +73,7 @@ bool ClangDiagnosticConfig::operator==(const ClangDiagnosticConfig &other) const
&& m_displayName == other.m_displayName
&& m_clangOptions == other.m_clangOptions
&& m_clangTidyMode == other.m_clangTidyMode
&& m_clangTidyChecksPrefixes == other.m_clangTidyChecksPrefixes
&& m_clangTidyChecksString == other.m_clangTidyChecksString
&& m_clangTidyChecks == other.m_clangTidyChecks
&& m_clazyChecks == other.m_clazyChecks
&& m_isReadOnly == other.m_isReadOnly;
}
@@ -96,35 +95,12 @@ void ClangDiagnosticConfig::setClangTidyMode(TidyMode 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;
return m_clangTidyChecks;
}
QString ClangDiagnosticConfig::clangTidyChecksPrefixes() const
void ClangDiagnosticConfig::setClangTidyChecks(const QString &checks)
{
return m_clangTidyChecksPrefixes;
}
void ClangDiagnosticConfig::setClangTidyChecksPrefixes(const QString &checks)
{
m_clangTidyChecksPrefixes = checks;
}
QString ClangDiagnosticConfig::clangTidyChecksString() const
{
return m_clangTidyChecksString;
}
void ClangDiagnosticConfig::setClangTidyChecksString(const QString &checks)
{
m_clangTidyChecksString = checks;
m_clangTidyChecks = checks;
}
QString ClangDiagnosticConfig::clazyChecks() const