Page MenuHomePhabricator

D11205.id26878.diff
No OneTemporary

D11205.id26878.diff

diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php
--- a/src/__phutil_library_map__.php
+++ b/src/__phutil_library_map__.php
@@ -123,6 +123,7 @@
'ArcanistMercurialParserTestCase' => 'repository/parser/__tests__/ArcanistMercurialParserTestCase.php',
'ArcanistMergeConflictLinter' => 'lint/linter/ArcanistMergeConflictLinter.php',
'ArcanistMergeConflictLinterTestCase' => 'lint/linter/__tests__/ArcanistMergeConflictLinterTestCase.php',
+ 'ArcanistMissingLinterException' => 'lint/linter/ArcanistMissingLinterException.php',
'ArcanistNoEffectException' => 'exception/usage/ArcanistNoEffectException.php',
'ArcanistNoEngineException' => 'exception/usage/ArcanistNoEngineException.php',
'ArcanistNoLintLinter' => 'lint/linter/ArcanistNoLintLinter.php',
@@ -306,6 +307,7 @@
'ArcanistMercurialParserTestCase' => 'ArcanistTestCase',
'ArcanistMergeConflictLinter' => 'ArcanistLinter',
'ArcanistMergeConflictLinterTestCase' => 'ArcanistArcanistLinterTestCase',
+ 'ArcanistMissingLinterException' => 'ArcanistUsageException',
'ArcanistNoEffectException' => 'ArcanistUsageException',
'ArcanistNoEngineException' => 'ArcanistUsageException',
'ArcanistNoLintLinter' => 'ArcanistLinter',
diff --git a/src/lint/linter/ArcanistExternalLinter.php b/src/lint/linter/ArcanistExternalLinter.php
--- a/src/lint/linter/ArcanistExternalLinter.php
+++ b/src/lint/linter/ArcanistExternalLinter.php
@@ -265,7 +265,7 @@
if ($interpreter) {
if (!Filesystem::binaryExists($interpreter)) {
- throw new ArcanistUsageException(
+ throw new ArcanistMissingLinterException(
pht(
'Unable to locate interpreter "%s" to run linter %s. You may '.
'need to install the interpreter, or adjust your linter '.
@@ -276,7 +276,7 @@
$this->getInstallInstructions()));
}
if (!Filesystem::pathExists($binary)) {
- throw new ArcanistUsageException(
+ throw new ArcanistMissingLinterException(
pht(
'Unable to locate script "%s" to run linter %s. You may need '.
'to install the script, or adjust your linter configuration. '.
@@ -287,7 +287,7 @@
}
} else {
if (!Filesystem::binaryExists($binary)) {
- throw new ArcanistUsageException(
+ throw new ArcanistMissingLinterException(
pht(
'Unable to locate binary "%s" to run linter %s. You may need '.
'to install the binary, or adjust your linter configuration. '.
diff --git a/src/lint/linter/ArcanistJSHintLinter.php b/src/lint/linter/ArcanistJSHintLinter.php
--- a/src/lint/linter/ArcanistJSHintLinter.php
+++ b/src/lint/linter/ArcanistJSHintLinter.php
@@ -148,7 +148,7 @@
if (!is_array($errors)) {
// Something went wrong and we can't decode the output. Exit abnormally.
- throw new ArcanistUsageException(
+ throw new RuntimeException(
"JSHint returned unparseable output.\n".
"stdout:\n\n{$stdout}".
"stderr:\n\n{$stderr}");
diff --git a/src/lint/linter/ArcanistMissingLinterException.php b/src/lint/linter/ArcanistMissingLinterException.php
new file mode 100644
--- /dev/null
+++ b/src/lint/linter/ArcanistMissingLinterException.php
@@ -0,0 +1,3 @@
+<?php
+
+final class ArcanistMissingLinterException extends ArcanistUsageException {}
diff --git a/src/lint/linter/ArcanistPyLintLinter.php b/src/lint/linter/ArcanistPyLintLinter.php
--- a/src/lint/linter/ArcanistPyLintLinter.php
+++ b/src/lint/linter/ArcanistPyLintLinter.php
@@ -108,7 +108,7 @@
list($err) = exec_manual('which %s', $pylint_bin);
if ($err) {
- throw new ArcanistUsageException(
+ throw new ArcanistMissingLinterException(
"PyLint does not appear to be installed on this system. Install it ".
"(e.g., with 'sudo easy_install pylint') or configure ".
"'lint.pylint.prefix' in your .arcconfig to point to the directory ".

File Metadata

Mime Type
text/plain
Expires
Wed, Apr 2, 3:31 PM (2 w, 6 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7729551
Default Alt Text
D11205.id26878.diff (3 KB)

Event Timeline