Changeset View
Changeset View
Standalone View
Standalone View
arcanist/linter/PrettierLinter.php
Show First 20 Lines • Show All 43 Lines • ▼ Show 20 Lines | public function getVersion() { | ||||
return false; | return false; | ||||
} | } | ||||
protected function parseLinterOutput($path, $err, $stdout, $stderr) { | protected function parseLinterOutput($path, $err, $stdout, $stderr) { | ||||
$root = $this->getProjectRoot(); | $root = $this->getProjectRoot(); | ||||
$path = Filesystem::resolvePath($path, $root); | $path = Filesystem::resolvePath($path, $root); | ||||
if ($err != 0) { | |||||
$message = id(new ArcanistLintMessage()) | |||||
->setPath($path) | |||||
->setLine(1) | |||||
->setChar(1) | |||||
->setGranularity(ArcanistLinter::GRANULARITY_FILE) | |||||
->setCode('PRETTIER') | |||||
->setSeverity(ArcanistLintSeverity::SEVERITY_ERROR) | |||||
->setName('Linter error') | |||||
->setDescription($stderr); | |||||
return array($message); | |||||
} | |||||
$orig = file_get_contents($path); | $orig = file_get_contents($path); | ||||
if ($orig == $stdout) { | if ($orig == $stdout) { | ||||
return array(); | return array(); | ||||
} | } | ||||
$message = id(new ArcanistLintMessage()) | $message = id(new ArcanistLintMessage()) | ||||
->setPath($path) | ->setPath($path) | ||||
->setLine(1) | ->setLine(1) | ||||
Show All 12 Lines |