Changeset View
Changeset View
Standalone View
Standalone View
src/lint/linter/ArcanistPhpcsLinter.php
| Show All 24 Lines | public function getLinterName() { | ||||
| return 'PHPCS'; | return 'PHPCS'; | ||||
| } | } | ||||
| public function getLinterConfigurationName() { | public function getLinterConfigurationName() { | ||||
| return 'phpcs'; | return 'phpcs'; | ||||
| } | } | ||||
| public function getInstallInstructions() { | public function getInstallInstructions() { | ||||
| return pht('Install PHPCS with `pear install PHP_CodeSniffer`.'); | return pht('Install PHPCS with `%s`.', 'pear install PHP_CodeSniffer'); | ||||
| } | } | ||||
| public function getLinterConfigurationOptions() { | public function getLinterConfigurationOptions() { | ||||
| $options = array( | $options = array( | ||||
| 'phpcs.standard' => array( | 'phpcs.standard' => array( | ||||
| 'type' => 'optional string', | 'type' => 'optional string', | ||||
| 'help' => pht('The name or path of the coding standard to use.'), | 'help' => pht('The name or path of the coding standard to use.'), | ||||
| ), | ), | ||||
| ▲ Show 20 Lines • Show All 105 Lines • ▼ Show 20 Lines | protected function getDefaultMessageSeverity($code) { | ||||
| } else { | } else { | ||||
| return ArcanistLintSeverity::SEVERITY_ERROR; | return ArcanistLintSeverity::SEVERITY_ERROR; | ||||
| } | } | ||||
| } | } | ||||
| protected function getLintCodeFromLinterConfigurationKey($code) { | protected function getLintCodeFromLinterConfigurationKey($code) { | ||||
| if (!preg_match('/^PHPCS\\.(E|W)\\./', $code)) { | if (!preg_match('/^PHPCS\\.(E|W)\\./', $code)) { | ||||
| throw new Exception( | throw new Exception( | ||||
| "Invalid severity code '{$code}', should begin with 'PHPCS.'."); | pht( | ||||
| "Invalid severity code '%s', should begin with '%s.'.", | |||||
| $code, | |||||
| 'PHPCS')); | |||||
| } | } | ||||
| return $code; | return $code; | ||||
| } | } | ||||
| } | } | ||||