1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-29 10:12:41 +01:00

Minor tidying of ArcanistCoffeeLintLinter

Summary: Self-explanatory.

Test Plan: N/A

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11199
This commit is contained in:
Joshua Spence 2015-01-05 06:44:33 +11:00
parent 9c07016ee4
commit 23f9a3ae66

View file

@ -42,7 +42,9 @@ final class ArcanistCoffeeLintLinter extends ArcanistExternalLinter {
} }
public function getInstallInstructions() { public function getInstallInstructions() {
return pht('Install CoffeeLint using `npm install -g coffeelint`.'); return pht(
'Install CoffeeLint using `%s`.',
'npm install -g coffeelint');
} }
public function shouldExpectCommandErrors() { public function shouldExpectCommandErrors() {
@ -102,17 +104,17 @@ final class ArcanistCoffeeLintLinter extends ArcanistExternalLinter {
$files = $report_dom->getElementsByTagName('file'); $files = $report_dom->getElementsByTagName('file');
$messages = array(); $messages = array();
foreach ($files as $file) { foreach ($files as $file) {
foreach ($file->getElementsByTagName('error') as $error) { foreach ($file->getElementsByTagName('error') as $error) {
// Column number is not provided in the output. // Column number is not provided in the output.
// See https://github.com/clutchski/coffeelint/issues/87 // See https://github.com/clutchski/coffeelint/issues/87
$message = new ArcanistLintMessage(); $message = id(new ArcanistLintMessage())
$message->setPath($path); ->setPath($path)
$message->setLine($error->getAttribute('line')); ->setLine($error->getAttribute('line'))
$message->setCode($this->getLinterName()); ->setCode($this->getLinterName())
$message->setDescription(preg_replace( ->setDescription(preg_replace(
'/; context: .*$/', '/; context: .*$/',
'.', '.',
$error->getAttribute('message'))); $error->getAttribute('message')));
@ -139,10 +141,8 @@ final class ArcanistCoffeeLintLinter extends ArcanistExternalLinter {
} }
protected function getLintCodeFromLinterConfigurationKey($code) { protected function getLintCodeFromLinterConfigurationKey($code) {
// NOTE: We can't figure out which rule generated each message, so we // NOTE: We can't figure out which rule generated each message, so we
// can not customize severities. // can not customize severities.
throw new Exception( throw new Exception(
pht( pht(
"CoffeeLint does not currently support custom severity levels, ". "CoffeeLint does not currently support custom severity levels, ".