Changeset View
Changeset View
Standalone View
Standalone View
src/lint/linter/ArcanistJSONLintLinter.php
| <?php | <?php | ||||
| /** | /** | ||||
| * A linter for JSON files. | * A linter for JSON files. | ||||
| */ | */ | ||||
| final class ArcanistJSONLintLinter extends ArcanistExternalLinter { | final class ArcanistJSONLintLinter extends ArcanistExternalLinter { | ||||
| public function getInfoName() { | public function getInfoName() { | ||||
| return 'JSON Lint'; | return 'JSON Lint'; | ||||
| } | } | ||||
| public function getInfoURI() { | public function getInfoURI() { | ||||
| return 'https://github.com/zaach/jsonlint'; | return 'https://github.com/zaach/jsonlint'; | ||||
| } | } | ||||
| public function getInfoDescription() { | public function getInfoDescription() { | ||||
| return pht('Use `jsonlint` to detect syntax errors in JSON files.'); | return pht('Use `%s` to detect syntax errors in JSON files.', 'jsonlint'); | ||||
| } | } | ||||
| public function getLinterName() { | public function getLinterName() { | ||||
| return 'JSON'; | return 'JSON'; | ||||
| } | } | ||||
| public function getLinterConfigurationName() { | public function getLinterConfigurationName() { | ||||
| return 'jsonlint'; | return 'jsonlint'; | ||||
| Show All 13 Lines | public function getVersion() { | ||||
| if (preg_match('/^(?P<version>\d+\.\d+\.\d+)$/', $stdout, $matches)) { | if (preg_match('/^(?P<version>\d+\.\d+\.\d+)$/', $stdout, $matches)) { | ||||
| return $matches['version']; | return $matches['version']; | ||||
| } else { | } else { | ||||
| return false; | return false; | ||||
| } | } | ||||
| } | } | ||||
| public function getInstallInstructions() { | public function getInstallInstructions() { | ||||
| return pht('Install jsonlint using `npm install -g jsonlint`.'); | return pht('Install jsonlint using `%s`.', 'npm install -g jsonlint'); | ||||
| } | } | ||||
| protected function getMandatoryFlags() { | protected function getMandatoryFlags() { | ||||
| return array( | return array( | ||||
| '--compact', | '--compact', | ||||
| ); | ); | ||||
| } | } | ||||
| Show All 34 Lines | |||||