forked from qt-creator/qt-creator
CppTools: Add convenience functions to ClangDiagnosticConfig
Change-Id: Iebf01e1ab71dc3500cc6e492c525735f300272ca Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This commit is contained in:
@@ -130,6 +130,11 @@ void ClangDiagnosticConfig::setClangTidyChecks(const QString &checks)
|
||||
m_clangTidyChecks = checks;
|
||||
}
|
||||
|
||||
bool ClangDiagnosticConfig::isClangTidyEnabled() const
|
||||
{
|
||||
return m_clangTidyMode != TidyMode::UseCustomChecks || clangTidyChecks() != "-*";
|
||||
}
|
||||
|
||||
QString ClangDiagnosticConfig::clazyChecks() const
|
||||
{
|
||||
return m_clazyChecks;
|
||||
@@ -140,6 +145,11 @@ void ClangDiagnosticConfig::setClazyChecks(const QString &checks)
|
||||
m_clazyChecks = checks;
|
||||
}
|
||||
|
||||
bool ClangDiagnosticConfig::isClazyEnabled() const
|
||||
{
|
||||
return m_clazyMode != ClazyMode::UseCustomChecks || !m_clazyChecks.isEmpty();
|
||||
}
|
||||
|
||||
static QString convertToNewClazyChecksFormat(const QString &checks)
|
||||
{
|
||||
// Before Qt Creator 4.9 valid values for checks were: "", "levelN".
|
||||
|
||||
@@ -71,6 +71,8 @@ public:
|
||||
QString clangTidyChecks() const;
|
||||
void setClangTidyChecks(const QString &checks);
|
||||
|
||||
bool isClangTidyEnabled() const;
|
||||
|
||||
// Clazy
|
||||
enum class ClazyMode
|
||||
{
|
||||
@@ -83,6 +85,8 @@ public:
|
||||
QString clazyChecks() const;
|
||||
void setClazyChecks(const QString &checks);
|
||||
|
||||
bool isClazyEnabled() const;
|
||||
|
||||
bool operator==(const ClangDiagnosticConfig &other) const;
|
||||
bool operator!=(const ClangDiagnosticConfig &other) const;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user