diff --git a/src/lint/engine/ArcanistLintEngine.php b/src/lint/engine/ArcanistLintEngine.php index b98a4514..8a4d1212 100644 --- a/src/lint/engine/ArcanistLintEngine.php +++ b/src/lint/engine/ArcanistLintEngine.php @@ -144,8 +144,8 @@ abstract class ArcanistLintEngine { $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 index e6f77187..78d4d428 100644 --- a/src/lint/linter/ArcanistClosureLinter.php +++ b/src/lint/linter/ArcanistClosureLinter.php @@ -37,10 +37,6 @@ final class ArcanistClosureLinter extends ArcanistExternalLinter { '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 index 66319037..3301356a 100644 --- a/src/lint/linter/ArcanistCoffeeLintLinter.php +++ b/src/lint/linter/ArcanistCoffeeLintLinter.php @@ -47,14 +47,6 @@ final class ArcanistCoffeeLintLinter extends ArcanistExternalLinter { '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 index 0e3f5b66..7d8b4bbc 100644 --- a/src/lint/linter/ArcanistCpplintLinter.php +++ b/src/lint/linter/ArcanistCpplintLinter.php @@ -29,14 +29,6 @@ final class ArcanistCpplintLinter extends ArcanistExternalLinter { '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 index 08f3e5cb..b8aceb8e 100644 --- a/src/lint/linter/ArcanistExternalLinter.php +++ b/src/lint/linter/ArcanistExternalLinter.php @@ -59,50 +59,6 @@ abstract class ArcanistExternalLinter extends ArcanistFutureLinter { return true; } - /** - * 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 @@ -373,18 +329,9 @@ abstract class ArcanistExternalLinter extends ArcanistFutureLinter { $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 index df22c25b..6274e045 100644 --- a/src/lint/linter/ArcanistHLintLinter.php +++ b/src/lint/linter/ArcanistHLintLinter.php @@ -33,14 +33,6 @@ final class ArcanistHLintLinter extends ArcanistExternalLinter { 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 index 064782f8..b4a65bdf 100644 --- a/src/lint/linter/ArcanistJSONLintLinter.php +++ b/src/lint/linter/ArcanistJSONLintLinter.php @@ -47,10 +47,6 @@ final class ArcanistJSONLintLinter extends ArcanistExternalLinter { 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 index f225bb35..5516540b 100644 --- a/src/lint/linter/ArcanistLesscLinter.php +++ b/src/lint/linter/ArcanistLesscLinter.php @@ -101,17 +101,6 @@ final class ArcanistLesscLinter extends ArcanistExternalLinter { 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 index 328e87ce..bd6b8222 100644 --- a/src/lint/linter/ArcanistPhpLinter.php +++ b/src/lint/linter/ArcanistPhpLinter.php @@ -55,10 +55,6 @@ final class ArcanistPhpLinter extends ArcanistExternalLinter { 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 index 8475c55a..68d4d7f3 100644 --- a/src/lint/linter/ArcanistPhpcsLinter.php +++ b/src/lint/linter/ArcanistPhpcsLinter.php @@ -96,10 +96,6 @@ final class ArcanistPhpcsLinter extends ArcanistExternalLinter { } } - 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 index 4180fc90..59d91995 100644 --- a/src/lint/linter/ArcanistPyFlakesLinter.php +++ b/src/lint/linter/ArcanistPyFlakesLinter.php @@ -53,10 +53,6 @@ final class ArcanistPyFlakesLinter extends ArcanistExternalLinter { 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 index bdf3ab82..b2d76567 100644 --- a/src/lint/linter/ArcanistRubyLinter.php +++ b/src/lint/linter/ArcanistRubyLinter.php @@ -50,10 +50,6 @@ final class ArcanistRubyLinter extends ArcanistExternalLinter { return pht('Install `ruby` from .'); } - public function supportsReadDataFromStdin() { - return true; - } - protected function getMandatoryFlags() { // -w: turn on warnings // -c: check syntax