Changeset View
Changeset View
Standalone View
Standalone View
src/lint/linter/ArcanistRubyLinter.php
| <?php | <?php | ||||
| /** | /** | ||||
| * Uses `ruby` to detect various errors in Ruby code. | * Uses `ruby` to detect various errors in Ruby code. | ||||
| */ | */ | ||||
| final class ArcanistRubyLinter extends ArcanistExternalLinter { | final class ArcanistRubyLinter extends ArcanistExternalLinter { | ||||
| public function getInfoURI() { | public function getInfoURI() { | ||||
| return 'https://www.ruby-lang.org/'; | return 'https://www.ruby-lang.org/'; | ||||
| } | } | ||||
| public function getInfoName() { | public function getInfoName() { | ||||
| return pht('Ruby'); | return pht('Ruby'); | ||||
| } | } | ||||
| public function getInfoDescription() { | public function getInfoDescription() { | ||||
| return pht('Use `ruby` to check for syntax errors in Ruby source files.'); | return pht( | ||||
| 'Use `%s` to check for syntax errors in Ruby source files.', | |||||
| 'ruby'); | |||||
| } | } | ||||
| public function getLinterName() { | public function getLinterName() { | ||||
| return 'RUBY'; | return 'RUBY'; | ||||
| } | } | ||||
| public function getLinterConfigurationName() { | public function getLinterConfigurationName() { | ||||
| return 'ruby'; | return 'ruby'; | ||||
| Show All 16 Lines | public function getVersion() { | ||||
| if (preg_match($regex, $stdout, $matches)) { | if (preg_match($regex, $stdout, $matches)) { | ||||
| return $matches['version']; | return $matches['version']; | ||||
| } else { | } else { | ||||
| return false; | return false; | ||||
| } | } | ||||
| } | } | ||||
| public function getInstallInstructions() { | public function getInstallInstructions() { | ||||
| return pht('Install `ruby` from <http://www.ruby-lang.org/>.'); | return pht('Install `%s` from <%s>.', 'ruby', 'http://www.ruby-lang.org/'); | ||||
| } | } | ||||
| protected function getMandatoryFlags() { | protected function getMandatoryFlags() { | ||||
| // -w: turn on warnings | // -w: turn on warnings | ||||
| // -c: check syntax | // -c: check syntax | ||||
| return array('-w', '-c'); | return array('-w', '-c'); | ||||
| } | } | ||||
| Show All 36 Lines | |||||