diff --git a/arcanist/linter/PrettierLinter.php b/arcanist/linter/PrettierLinter.php index 46251b462..ab89f296a 100644 --- a/arcanist/linter/PrettierLinter.php +++ b/arcanist/linter/PrettierLinter.php @@ -1,85 +1,83 @@ getExecutableCommand()); $matches = array(); $regex = '/^(?P\d+\.\d+\.\d+)$/'; if (preg_match($regex, $stdout, $matches)) { return $matches['version']; } return false; } protected function parseLinterOutput($path, $err, $stdout, $stderr) { $root = $this->getProjectRoot(); $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); + ->setPath($path) + ->setGranularity(ArcanistLinter::GRANULARITY_FILE) + ->setCode('PRETTIER') + ->setSeverity(ArcanistLintSeverity::SEVERITY_ERROR) + ->setName('Linter error') + ->setDescription($stderr); return array($message); } $orig = file_get_contents($path); if ($orig == $stdout) { return array(); } $message = id(new ArcanistLintMessage()) - ->setPath($path) - ->setLine(1) - ->setChar(1) - ->setGranularity(ArcanistLinter::GRANULARITY_FILE) - ->setCode('PRETTIER') - ->setSeverity(ArcanistLintSeverity::SEVERITY_AUTOFIX) - ->setName('Code style violation') - ->setDescription("'$path' has code style errors.") - ->setOriginalText($orig) - ->setReplacementText($stdout); + ->setPath($path) + ->setLine(1) + ->setChar(1) + ->setGranularity(ArcanistLinter::GRANULARITY_FILE) + ->setCode('PRETTIER') + ->setSeverity(ArcanistLintSeverity::SEVERITY_AUTOFIX) + ->setName('Code style violation') + ->setDescription("'$path' has code style errors.") + ->setOriginalText($orig) + ->setReplacementText($stdout); return array($message); } }