GUI: Fix warning ids and severities for clang/clang-tidy warnings

This commit is contained in:
Daniel Marjamäki 2017-09-22 22:32:02 +02:00
parent 9f306cf3aa
commit 233a6d2fc6
1 changed files with 15 additions and 7 deletions

View File

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