Commit cd316a7f authored by Kai Stierand's avatar Kai Stierand Committed by Milian Wolff
Browse files

plugins/clangtidy: fix problem pattern to also match windows paths

A path may now start either with 'X:\' or '/'
parent ded59fa0
......@@ -64,8 +64,8 @@ QString verboseMessageToHtml(const QString& input)
ClangTidyParser::ClangTidyParser(QObject* parent)
: QObject(parent)
// (1filename ) (2lin) (3col) (4se) (5d) (6explain)
, m_hitRegExp(QStringLiteral("(\\/.+\\.[ch]{1,2}[px]{0,2}):(\\d+):(\\d+): (.+?): (.+) (\\[.+\\])"))
// (1/2 filename ) (3ln) (4cl) (5se) (6d) (7expln)
, m_hitRegExp(QStringLiteral(R"aw((([A-Za-z]:\\|\/).+\.[ch]{1,2}[px]{0,2}):(\d+):(\d+): (.+?): (.+) (\[.+\]))aw"))
{
}
......@@ -82,16 +82,16 @@ void ClangTidyParser::addData(const QStringList& stdoutList)
IProblem::Ptr problem(new DetectedProblem());
problem->setSource(IProblem::Plugin);
problem->setDescription(smatch.captured(5));
problem->setExplanation(smatch.captured(6));
problem->setDescription(smatch.captured(6));
problem->setExplanation(smatch.captured(7));
DocumentRange range;
range.document = IndexedString(smatch.captured(1));
range.setBothColumns(smatch.capturedRef(3).toInt() - 1);
range.setBothLines(smatch.capturedRef(2).toInt() - 1);
range.setBothColumns(smatch.capturedRef(4).toInt() - 1);
range.setBothLines(smatch.capturedRef(3).toInt() - 1);
problem->setFinalLocation(range);
const auto sev = smatch.capturedRef(4);
const auto sev = smatch.capturedRef(5);
const IProblem::Severity erity =
(sev == QLatin1String("error")) ? IProblem::Error :
(sev == QLatin1String("warning")) ? IProblem::Warning :
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment