forked from qt-creator/qt-creator
ClangTools: Prefer .clang-tidy file by default
... and move this setting outside the diagnostic config. Fixes: QTCREATORBUG-28852 Change-Id: Ie3b19ba7bec2bc96451f3216fa06a6941cad4c94 Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -98,15 +98,12 @@ ClangDiagnosticConfig diagnosticConfig()
|
||||
return warningsConfigForProject(project);
|
||||
}
|
||||
|
||||
bool isDiagnosticConfigChangable(Project *project, const ClangDiagnostic &diagnostic)
|
||||
static bool isDiagnosticConfigChangable(Project *project)
|
||||
{
|
||||
if (!project)
|
||||
return false;
|
||||
const ClangDiagnosticConfig config = diagnosticConfig();
|
||||
if (config.clangTidyMode() == ClangDiagnosticConfig::TidyMode::UseConfigFile
|
||||
&& diagnosticType(diagnostic) == DiagnosticType::Tidy) {
|
||||
if (diagnosticConfig().useBuildSystemWarnings())
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -308,7 +305,7 @@ ClangdTextMark::ClangdTextMark(const FilePath &filePath,
|
||||
|
||||
// Remove diagnostic warning action
|
||||
Project *project = projectForCurrentEditor();
|
||||
if (project && isDiagnosticConfigChangable(project, diag)) {
|
||||
if (project && isDiagnosticConfigChangable(project)) {
|
||||
action = new QAction();
|
||||
action->setIcon(Icons::BROKEN.icon());
|
||||
action->setToolTip(Tr::tr("Disable Diagnostic in Current Project"));
|
||||
|
||||
Reference in New Issue
Block a user