Changeset View
Changeset View
Standalone View
Standalone View
src/lint/linter/ArcanistRuboCopLinter.php
Show First 20 Lines • Show All 78 Lines • ▼ Show 20 Lines | final class ArcanistRuboCopLinter extends ArcanistExternalLinter { | ||||
} | } | ||||
protected function parseLinterOutput($path, $err, $stdout, $stderr) { | protected function parseLinterOutput($path, $err, $stdout, $stderr) { | ||||
$results = phutil_json_decode($stdout); | $results = phutil_json_decode($stdout); | ||||
$messages = array(); | $messages = array(); | ||||
foreach ($results['files'] as $file) { | foreach ($results['files'] as $file) { | ||||
foreach ($file['offenses'] as $offense) { | foreach ($file['offenses'] as $offense) { | ||||
$message = id(new ArcanistLintMessage()) | $message = (new ArcanistLintMessage()) | ||||
->setPath($file['path']) | ->setPath($file['path']) | ||||
->setDescription($offense['message']) | ->setDescription($offense['message']) | ||||
->setLine($offense['location']['line']) | ->setLine($offense['location']['line']) | ||||
->setChar($offense['location']['column']) | ->setChar($offense['location']['column']) | ||||
->setSeverity($this->getLintMessageSeverity($offense['severity'])) | ->setSeverity($this->getLintMessageSeverity($offense['severity'])) | ||||
->setName($this->getLinterName()) | ->setName($this->getLinterName()) | ||||
->setCode($offense['cop_name']); | ->setCode($offense['cop_name']); | ||||
$messages[] = $message; | $messages[] = $message; | ||||
Show All 25 Lines |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0