Changeset View
Changeset View
Standalone View
Standalone View
src/lint/linter/ArcanistCppcheckLinter.php
| Show First 20 Lines • Show All 75 Lines • ▼ Show 20 Lines | protected function parseLinterOutput($path, $err, $stdout, $stderr) { | ||||
| if (!$ok) { | if (!$ok) { | ||||
| return false; | return false; | ||||
| } | } | ||||
| $errors = $dom->getElementsByTagName('error'); | $errors = $dom->getElementsByTagName('error'); | ||||
| $messages = array(); | $messages = array(); | ||||
| foreach ($errors as $error) { | foreach ($errors as $error) { | ||||
| foreach ($error->getElementsByTagName('location') as $location) { | foreach ($error->getElementsByTagName('location') as $location) { | ||||
| $message = new ArcanistLintMessage(); | $message = id(new ArcanistLintMessage()) | ||||
| $message->setPath($location->getAttribute('file')); | ->setPath($location->getAttribute('file')) | ||||
| $message->setLine($location->getAttribute('line')); | ->setLine($location->getAttribute('line')) | ||||
| $message->setCode('Cppcheck'); | ->setName($error->getAttribute('id')) | ||||
| $message->setName($error->getAttribute('id')); | ->setDescription($error->getAttribute('msg')); | ||||
| $message->setDescription($error->getAttribute('msg')); | |||||
| switch ($error->getAttribute('severity')) { | switch ($error->getAttribute('severity')) { | ||||
| case 'error': | case 'error': | ||||
| $message->setSeverity(ArcanistLintSeverity::SEVERITY_ERROR); | $message->setSeverity(ArcanistLintSeverity::SEVERITY_ERROR); | ||||
| break; | break; | ||||
| default: | default: | ||||
| if ($error->getAttribute('inconclusive')) { | if ($error->getAttribute('inconclusive')) { | ||||
| Show All 15 Lines | |||||