Page MenuHomePhabricator

D14501.diff
No OneTemporary

D14501.diff

diff --git a/src/lint/linter/ArcanistLesscLinter.php b/src/lint/linter/ArcanistLesscLinter.php
--- a/src/lint/linter/ArcanistLesscLinter.php
+++ b/src/lint/linter/ArcanistLesscLinter.php
@@ -88,7 +88,10 @@
}
public function getVersion() {
- list($stdout) = execx('%C --version', $this->getExecutableCommand());
+ list($err, $stdout) = exec_manual(
+ '%C --version',
+ $this->getExecutableCommand());
+ // In 1.5.1, `--version` exit code is 1.
$matches = array();
$regex = '/^lessc (?P<version>\d+\.\d+\.\d+)\b/';
@@ -126,42 +129,6 @@
$matches);
if ($match) {
- switch ($matches['name']) {
- case 'RuntimeError':
- $code = self::LINT_RUNTIME_ERROR;
- break;
-
- case 'ArgumentError':
- $code = self::LINT_ARGUMENT_ERROR;
- break;
-
- case 'FileError':
- $code = self::LINT_FILE_ERROR;
- break;
-
- case 'NameError':
- $code = self::LINT_NAME_ERROR;
- break;
-
- case 'OperationError':
- $code = self::LINT_OPERATION_ERROR;
- break;
-
- case 'ParseError':
- $code = self::LINT_PARSE_ERROR;
- break;
-
- case 'SyntaxError':
- $code = self::LINT_SYNTAX_ERROR;
- break;
-
- default:
- throw new RuntimeException(
- pht(
- 'Unrecognized lint message code "%s".',
- $code));
- }
-
$code = $this->getLintCodeFromLinterConfigurationKey($matches['name']);
$message = new ArcanistLintMessage();
@@ -180,4 +147,34 @@
return $messages;
}
+ protected function getLintCodeFromLinterConfigurationKey($code) {
+ switch ($code) {
+ case 'RuntimeError':
+ return self::LINT_RUNTIME_ERROR;
+
+ case 'ArgumentError':
+ return self::LINT_ARGUMENT_ERROR;
+
+ case 'FileError':
+ return self::LINT_FILE_ERROR;
+
+ case 'NameError':
+ return self::LINT_NAME_ERROR;
+
+ case 'OperationError':
+ return self::LINT_OPERATION_ERROR;
+
+ case 'ParseError':
+ return self::LINT_PARSE_ERROR;
+
+ case 'SyntaxError':
+ return self::LINT_SYNTAX_ERROR;
+
+ default:
+ throw new RuntimeException(
+ pht(
+ 'Unrecognized lint message code "%s".',
+ $code));
+ }
+ }
}

File Metadata

Mime Type
text/plain
Expires
Mon, Mar 10, 10:32 AM (3 w, 3 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7384474
Default Alt Text
D14501.diff (2 KB)

Event Timeline