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:
Christian Kandeler
2023-04-11 12:49:21 +02:00
parent de0e0fab18
commit 4028777743
16 changed files with 83 additions and 79 deletions

View File

@@ -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"));