Page MenuHomePhabricator

D10220.diff
No OneTemporary

D10220.diff

diff --git a/src/lint/linter/ArcanistCSSLintLinter.php b/src/lint/linter/ArcanistCSSLintLinter.php
--- a/src/lint/linter/ArcanistCSSLintLinter.php
+++ b/src/lint/linter/ArcanistCSSLintLinter.php
@@ -37,7 +37,22 @@
}
public function getDefaultBinary() {
- return $this->getDeprecatedConfiguration('lint.csslint.bin', 'csslint');
+ $binary = $this->getDeprecatedConfiguration('lint.csslint.bin', 'csslint');
+
+ if (Filesystem::binaryExists($binary)) {
+ return $binary;
+ } else {
+ return './node_modules/csslint/cli.js';
+ }
+ }
+
+ public function shouldUseInterpreter() {
+ $binary = $this->getDefaultBinary();
+ return $binary[strlen($binary) - 3] == '.js';
+ }
+
+ public function getDefaultInterpreter() {
+ return 'node';
}
public function getVersion() {
diff --git a/src/lint/linter/ArcanistCoffeeLintLinter.php b/src/lint/linter/ArcanistCoffeeLintLinter.php
--- a/src/lint/linter/ArcanistCoffeeLintLinter.php
+++ b/src/lint/linter/ArcanistCoffeeLintLinter.php
@@ -27,7 +27,19 @@
}
public function getDefaultBinary() {
- return 'coffeelint';
+ if (Filesystem::binaryExists('coffeelint')) {
+ return 'coffeelint';
+ } else {
+ return './node_modules/coffeelint/bin/coffeelint';
+ }
+ }
+
+ public function shouldUseInterpreter() {
+ return ($this->getDefaultBinary() !== 'coffeelint');
+ }
+
+ public function getDefaultInterpreter() {
+ return 'node';
}
public function getVersion() {
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
@@ -54,6 +54,14 @@
}
}
+ public function shouldUseInterpreter() {
+ return ($this->getDefaultBinary() !== 'jshint');
+ }
+
+ public function getDefaultInterpreter() {
+ return 'node';
+ }
+
public function getVersion() {
// NOTE: `jshint --version` emits version information on stderr, not stdout.
list($stdout, $stderr) = execx(
diff --git a/src/lint/linter/ArcanistJSONLintLinter.php b/src/lint/linter/ArcanistJSONLintLinter.php
--- a/src/lint/linter/ArcanistJSONLintLinter.php
+++ b/src/lint/linter/ArcanistJSONLintLinter.php
@@ -26,7 +26,19 @@
}
public function getDefaultBinary() {
- return 'jsonlint';
+ if (Filesystem::binaryExists('jsonlint')) {
+ return 'jsonlint';
+ } else {
+ return './node_modules/jsonlint/lib/cli.js';
+ }
+ }
+
+ public function shouldUseInterpreter() {
+ return ($this->getDefaultBinary() !== 'jsonlint');
+ }
+
+ public function getDefaultInterpreter() {
+ return 'node';
}
public function getVersion() {
diff --git a/src/lint/linter/ArcanistJscsLinter.php b/src/lint/linter/ArcanistJscsLinter.php
--- a/src/lint/linter/ArcanistJscsLinter.php
+++ b/src/lint/linter/ArcanistJscsLinter.php
@@ -26,7 +26,19 @@
}
public function getDefaultBinary() {
- return 'jscs';
+ if (Filesystem::binaryExists('jscs')) {
+ return 'jscs';
+ } else {
+ return './node_modules/jscs/bin/jscs';
+ }
+ }
+
+ public function shouldUseInterpreter() {
+ return ($this->getDefaultBinary() !== 'jscs');
+ }
+
+ public function getDefaultInterpreter() {
+ return 'node';
}
public function getVersion() {
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
@@ -82,7 +82,19 @@
}
public function getDefaultBinary() {
- return 'lessc';
+ if (Filesystem::binaryExists('lessc')) {
+ return 'lessc';
+ } else {
+ return './node_modules/less/bin/lessc';
+ }
+ }
+
+ public function shouldUseInterpreter() {
+ return ($this->getDefaultBinary() !== 'lessc');
+ }
+
+ public function getDefaultInterpreter() {
+ return 'node';
}
public function getVersion() {

File Metadata

Mime Type
text/plain
Expires
Fri, Nov 29, 2:22 AM (10 h, 36 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6803352
Default Alt Text
D10220.diff (3 KB)

Event Timeline