Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15399867
D12696.id30534.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
8 KB
Referenced Files
None
Subscribers
None
D12696.id30534.diff
View Options
diff --git a/src/lint/engine/ArcanistLintEngine.php b/src/lint/engine/ArcanistLintEngine.php
--- a/src/lint/engine/ArcanistLintEngine.php
+++ b/src/lint/engine/ArcanistLintEngine.php
@@ -144,8 +144,8 @@
$this->fileData[$path] = $this->getHookAPI()
->getCurrentFileData($path);
} else {
- $disk_path = $this->getFilePathOnDisk($path);
- $this->fileData[$path] = Filesystem::readFile($disk_path);
+ $disk_path = $this->getFilePathOnDisk($path);
+ $this->fileData[$path] = Filesystem::readFile($disk_path);
}
}
return $this->fileData[$path];
diff --git a/src/lint/linter/ArcanistClosureLinter.php b/src/lint/linter/ArcanistClosureLinter.php
--- a/src/lint/linter/ArcanistClosureLinter.php
+++ b/src/lint/linter/ArcanistClosureLinter.php
@@ -37,10 +37,6 @@
'files/closure_linter-latest.tar.gz');
}
- public function supportsReadDataFromStdin() {
- return false;
- }
-
protected function parseLinterOutput($path, $err, $stdout, $stderr) {
$lines = phutil_split_lines($stdout, false);
$messages = array();
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
@@ -47,14 +47,6 @@
'npm install -g coffeelint');
}
- public function supportsReadDataFromStdin() {
- return true;
- }
-
- public function getReadDataFromStdinFilename() {
- return '--stdin';
- }
-
protected function getMandatoryFlags() {
$options = array(
'--reporter=raw',
diff --git a/src/lint/linter/ArcanistCpplintLinter.php b/src/lint/linter/ArcanistCpplintLinter.php
--- a/src/lint/linter/ArcanistCpplintLinter.php
+++ b/src/lint/linter/ArcanistCpplintLinter.php
@@ -29,14 +29,6 @@
'googlecode.com/svn/trunk/cpplint/cpplint.py`.');
}
- public function supportsReadDataFromStdin() {
- return true;
- }
-
- public function getReadDataFromStdinFilename() {
- return '-';
- }
-
protected function getDefaultFlags() {
return $this->getDeprecatedConfiguration('lint.cpplint.options', array());
}
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
@@ -60,50 +60,6 @@
}
/**
- * Return true to indicate that the external linter can read input from
- * stdin, rather than requiring a file. If this mode is supported, it is
- * slightly more flexible and may perform better, and is thus preferable.
- *
- * To send data over stdin instead of via a command line parameter, override
- * this method and return true. If the linter also needs a command line
- * flag (like `--stdin` or `-`), override
- * @{method:getReadDataFromStdinFilename} to provide it.
- *
- * For example, linters are normally invoked something like this:
- *
- * $ linter file.js
- *
- * If you override this method, invocation will be more similar to this:
- *
- * $ linter < file.js
- *
- * If you additionally override @{method:getReadDataFromStdinFilename} to
- * return `"-"`, invocation will be similar to this:
- *
- * $ linter - < file.js
- *
- * @return bool True to send data over stdin.
- * @task bin
- */
- public function supportsReadDataFromStdin() {
- return false;
- }
-
- /**
- * If the linter can read data over stdin, override
- * @{method:supportsReadDataFromStdin} and then optionally override this
- * method to provide any required arguments (like `-` or `--stdin`). See
- * that method for discussion.
- *
- * @return string|null Additional arguments required by the linter when
- * operating in stdin mode.
- * @task bin
- */
- public function getReadDataFromStdinFilename() {
- return null;
- }
-
- /**
* Provide mandatory, non-overridable flags to the linter. Generally these
* are format flags, like `--format=xml`, which must always be given for
* the output to be usable.
@@ -373,18 +329,9 @@
$futures = array();
foreach ($paths as $path) {
- if ($this->supportsReadDataFromStdin()) {
- $future = new ExecFuture(
- '%C %C',
- $bin,
- $this->getReadDataFromStdinFilename());
- $future->write($this->getEngine()->loadData($path));
- } else {
- // TODO: In commit hook mode, we need to do more handling here.
- $disk_path = $this->getEngine()->getFilePathOnDisk($path);
- $path_argument = $this->getPathArgumentForLinterFuture($disk_path);
- $future = new ExecFuture('%C %C', $bin, $path_argument);
- }
+ $disk_path = $this->getEngine()->getFilePathOnDisk($path);
+ $path_argument = $this->getPathArgumentForLinterFuture($disk_path);
+ $future = new ExecFuture('%C %C', $bin, $path_argument);
$future->setCWD($this->getEngine()->getWorkingCopy()->getProjectRoot());
$futures[$path] = $future;
diff --git a/src/lint/linter/ArcanistHLintLinter.php b/src/lint/linter/ArcanistHLintLinter.php
--- a/src/lint/linter/ArcanistHLintLinter.php
+++ b/src/lint/linter/ArcanistHLintLinter.php
@@ -33,14 +33,6 @@
return pht('Install hlint with `cabal install hlint`.');
}
- public function supportsReadDataFromStdin() {
- return true;
- }
-
- public function getReadDataFromStdinFilename() {
- return '-';
- }
-
protected function getMandatoryFlags() {
return array('--json');
}
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
@@ -47,10 +47,6 @@
return pht('Install jsonlint using `npm install -g jsonlint`.');
}
- public function supportsReadDataFromStdin() {
- return true;
- }
-
protected function getMandatoryFlags() {
return array(
'--compact',
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
@@ -101,17 +101,6 @@
return pht('Install lessc using `npm install -g less`.');
}
- public function supportsReadDataFromStdin() {
- // Technically `lessc` can read data from standard input however, when doing
- // so, relative imports cannot be resolved. Therefore, this functionality is
- // disabled.
- return false;
- }
-
- public function getReadDataFromStdinFilename() {
- return '-';
- }
-
protected function getMandatoryFlags() {
return array(
'--lint',
diff --git a/src/lint/linter/ArcanistPhpLinter.php b/src/lint/linter/ArcanistPhpLinter.php
--- a/src/lint/linter/ArcanistPhpLinter.php
+++ b/src/lint/linter/ArcanistPhpLinter.php
@@ -55,10 +55,6 @@
return $stdout;
}
- public function supportsReadDataFromStdin() {
- return false;
- }
-
protected function canCustomizeLintSeverities() {
return false;
}
diff --git a/src/lint/linter/ArcanistPhpcsLinter.php b/src/lint/linter/ArcanistPhpcsLinter.php
--- a/src/lint/linter/ArcanistPhpcsLinter.php
+++ b/src/lint/linter/ArcanistPhpcsLinter.php
@@ -96,10 +96,6 @@
}
}
- public function supportsReadDataFromStdin() {
- return true;
- }
-
protected function parseLinterOutput($path, $err, $stdout, $stderr) {
// NOTE: Some version of PHPCS after 1.4.6 stopped printing a valid, empty
// XML document to stdout in the case of no errors. If PHPCS exits with
diff --git a/src/lint/linter/ArcanistPyFlakesLinter.php b/src/lint/linter/ArcanistPyFlakesLinter.php
--- a/src/lint/linter/ArcanistPyFlakesLinter.php
+++ b/src/lint/linter/ArcanistPyFlakesLinter.php
@@ -53,10 +53,6 @@
return pht('Install pyflakes with `pip install pyflakes`.');
}
- public function supportsReadDataFromStdin() {
- return true;
- }
-
protected function parseLinterOutput($path, $err, $stdout, $stderr) {
$lines = phutil_split_lines($stdout, false);
diff --git a/src/lint/linter/ArcanistRubyLinter.php b/src/lint/linter/ArcanistRubyLinter.php
--- a/src/lint/linter/ArcanistRubyLinter.php
+++ b/src/lint/linter/ArcanistRubyLinter.php
@@ -50,10 +50,6 @@
return pht('Install `ruby` from <http://www.ruby-lang.org/>.');
}
- public function supportsReadDataFromStdin() {
- return true;
- }
-
protected function getMandatoryFlags() {
// -w: turn on warnings
// -c: check syntax
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Mar 18, 8:13 AM (4 d, 13 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7708480
Default Alt Text
D12696.id30534.diff (8 KB)
Attached To
Mode
D12696: Remove support for passing data via STDIN
Attached
Detach File
Event Timeline
Log In to Comment