Changeset View
Changeset View
Standalone View
Standalone View
src/lint/linter/ArcanistRuboCopLinter.php
Show All 28 Lines | final class ArcanistRuboCopLinter extends ArcanistExternalLinter { | ||||
public function getDefaultBinary() { | public function getDefaultBinary() { | ||||
return 'rubocop'; | return 'rubocop'; | ||||
} | } | ||||
public function getVersion() { | public function getVersion() { | ||||
list($stdout) = execx('%C --version', $this->getExecutableCommand()); | list($stdout) = execx('%C --version', $this->getExecutableCommand()); | ||||
$matches = array(); | $matches = array(); | ||||
if (preg_match('/^(?P<version>\d+\.\d+\.\d+)$/', $stdout, $matches)) { | if (preg_match('/^(?P<version>\d+\.\d+\.\d+)\s*$/', $stdout, $matches)) { | ||||
return $matches['version']; | return $matches['version']; | ||||
} else { | } else { | ||||
return false; | return false; | ||||
} | } | ||||
} | } | ||||
public function getInstallInstructions() { | public function getInstallInstructions() { | ||||
return pht('Install RuboCop using `%s`.', 'gem install rubocop'); | return pht('Install RuboCop using `%s`.', 'gem install rubocop'); | ||||
▲ Show 20 Lines • Show All 75 Lines • Show Last 20 Lines |