forked from qt-creator/qt-creator
Clang: Add tooltip action to remove specific warnings/checks
...from the diagnostic configuration. If no custom diagnostic configuration is set in Projects Mode > Clang, one is created and set for the current project. Otherwise the current custom diagnostic set in the project settings is modified. Change-Id: I5c48280c90f0e807e7333122d504dda302a8b0a9 Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
This commit is contained in:
@@ -25,6 +25,7 @@
|
||||
|
||||
#include "clangdiagnosticconfigsmodel.h"
|
||||
|
||||
#include "cpptoolsreuse.h"
|
||||
#include "cpptoolsconstants.h"
|
||||
|
||||
#include <utils/algorithm.h>
|
||||
@@ -73,7 +74,6 @@ constexpr const char *DEFAULT_TIDY_CHECKS = "-*,"
|
||||
"-readability-braces-around-statements,"
|
||||
"-readability-implicit-bool-conversion,"
|
||||
"-readability-named-parameter";
|
||||
constexpr const char *DEFAULT_CLAZY_CHECKS = "level0";
|
||||
|
||||
static void addConfigForAlmostEveryWarning(ClangDiagnosticConfigsModel &model)
|
||||
{
|
||||
@@ -141,7 +141,7 @@ static void addConfigForClazy(ClangDiagnosticConfigsModel &model)
|
||||
"Clazy level0 checks"));
|
||||
config.setIsReadOnly(true);
|
||||
config.setClangOptions(QStringList{QStringLiteral("-w")});
|
||||
config.setClazyChecks(QString::fromUtf8(DEFAULT_CLAZY_CHECKS));
|
||||
config.setClazyChecks(clazyChecksForLevel(0));
|
||||
|
||||
model.appendOrUpdate(config);
|
||||
}
|
||||
@@ -157,7 +157,7 @@ static void addConfigForTidyAndClazy(ClangDiagnosticConfigsModel &model)
|
||||
config.setClangTidyMode(ClangDiagnosticConfig::TidyMode::ChecksPrefixList);
|
||||
|
||||
config.setClangTidyChecks(QString::fromUtf8(DEFAULT_TIDY_CHECKS));
|
||||
config.setClazyChecks(QString::fromUtf8(DEFAULT_CLAZY_CHECKS));
|
||||
config.setClazyChecks(clazyChecksForLevel(0));
|
||||
|
||||
model.appendOrUpdate(config);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user