From 233a6d2fc6aa7e3fce5c200908faf05f10d88ec3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Fri, 22 Sep 2017 22:32:02 +0200 Subject: [PATCH] GUI: Fix warning ids and severities for clang/clang-tidy warnings --- gui/checkthread.cpp | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/gui/checkthread.cpp b/gui/checkthread.cpp index e32f927f7..1ee28f2ac 100644 --- a/gui/checkthread.cpp +++ b/gui/checkthread.cpp @@ -397,13 +397,21 @@ void CheckThread::parseClangErrors(const QString &tool, const QString &file0, QS QString message,id; if (r2.exactMatch(r1.cap(5))) { message = r2.cap(1); - id = tool + '-' + r2.cap(2); - if (r2.cap(2) == "performance") - errorItem.severity = Severity::SeverityType::performance; - else if (r2.cap(2) == "portability") - errorItem.severity = Severity::SeverityType::portability; - else if (r2.cap(2) == "readability") - errorItem.severity = Severity::SeverityType::style; + const QString id1(r2.cap(2)); + if (id1.startsWith("clang")) + id = id1; + else + id = tool + '-' + r2.cap(2); + if (tool == CLANG_TIDY) { + if (id1.startsWith("performance")) + errorItem.severity = Severity::SeverityType::performance; + else if (id1.startsWith("portability")) + errorItem.severity = Severity::SeverityType::portability; + else if (id1.startsWith("cert") || (id1.startsWith("misc") && !id1.contains("unused"))) + errorItem.severity = Severity::SeverityType::warning; + else + errorItem.severity = Severity::SeverityType::style; + } } else { message = r1.cap(5); id = CLANG_ANALYZER;