Changeset View
Changeset View
Standalone View
Standalone View
src/lint/linter/ArcanistCpplintLinter.php
| Show All 29 Lines | final class ArcanistCpplintLinter extends ArcanistExternalLinter { | ||||
| protected function parseLinterOutput($path, $err, $stdout, $stderr) { | protected function parseLinterOutput($path, $err, $stdout, $stderr) { | ||||
| $lines = explode("\n", $stderr); | $lines = explode("\n", $stderr); | ||||
| $messages = array(); | $messages = array(); | ||||
| foreach ($lines as $line) { | foreach ($lines as $line) { | ||||
| $line = trim($line); | $line = trim($line); | ||||
| $matches = null; | $matches = null; | ||||
| $regex = '/^-:(\d+):\s*(.*)\s*\[(.*)\] \[(\d+)\]$/'; | $regex = '/(\d+):\s*(.*)\s*\[(.*)\] \[(\d+)\]$/'; | ||||
| if (!preg_match($regex, $line, $matches)) { | if (!preg_match($regex, $line, $matches)) { | ||||
| continue; | continue; | ||||
| } | } | ||||
| foreach ($matches as $key => $match) { | foreach ($matches as $key => $match) { | ||||
| $matches[$key] = trim($match); | $matches[$key] = trim($match); | ||||
| } | } | ||||
| $severity = $this->getLintMessageSeverity($matches[3]); | $severity = $this->getLintMessageSeverity($matches[3]); | ||||
| Show All 30 Lines | |||||