1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-10 08:52:39 +01:00

Change the default value for ArcanistExternalLinter::shouldExpectCommandErrors

Summary: It is more common for linters to exit with a non-zero status than it is for linters to return with a zero exit status, Really this function serves very little purposes, it simply determines whether or not to throw an exception if a non-zero status is returned by the external linter.

Test Plan: `arc unit`

Reviewers: chad, epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11322
This commit is contained in:
Joshua Spence 2015-01-12 07:21:33 +11:00
parent 564dab0989
commit 23bc9f294c
19 changed files with 9 additions and 65 deletions

View file

@ -58,10 +58,6 @@ final class ArcanistCSSLintLinter extends ArcanistExternalLinter {
'npm install -g csslint');
}
public function shouldExpectCommandErrors() {
return true;
}
protected function parseLinterOutput($path, $err, $stdout, $stderr) {
$report_dom = new DOMDocument();
$ok = @$report_dom->loadXML($stdout);

View file

@ -37,10 +37,6 @@ final class ArcanistClosureLinter extends ArcanistExternalLinter {
'files/closure_linter-latest.tar.gz');
}
public function shouldExpectCommandErrors() {
return true;
}
public function supportsReadDataFromStdin() {
return false;
}

View file

@ -47,10 +47,6 @@ final class ArcanistCoffeeLintLinter extends ArcanistExternalLinter {
'npm install -g coffeelint');
}
public function shouldExpectCommandErrors() {
return true;
}
public function supportsReadDataFromStdin() {
return true;
}

View file

@ -67,6 +67,10 @@ final class ArcanistCppcheckLinter extends ArcanistExternalLinter {
array('-j2', '--enable=performance,style,portability,information'));
}
public function shouldExpectCommandErrors() {
return false;
}
protected function parseLinterOutput($path, $err, $stdout, $stderr) {
$dom = new DOMDocument();
$ok = @$dom->loadXML($stderr);

View file

@ -29,10 +29,6 @@ final class ArcanistCpplintLinter extends ArcanistExternalLinter {
'googlecode.com/svn/trunk/cpplint/cpplint.py`.');
}
public function shouldExpectCommandErrors() {
return true;
}
public function supportsReadDataFromStdin() {
return true;
}

View file

@ -56,7 +56,7 @@ abstract class ArcanistExternalLinter extends ArcanistFutureLinter {
* @task bin
*/
public function shouldExpectCommandErrors() {
return false;
return true;
}
/**

View file

@ -58,10 +58,6 @@ final class ArcanistFlake8Linter extends ArcanistExternalLinter {
return pht('Install flake8 using `easy_install flake8`.');
}
public function shouldExpectCommandErrors() {
return true;
}
protected function parseLinterOutput($path, $err, $stdout, $stderr) {
$lines = phutil_split_lines($stdout, false);

View file

@ -30,6 +30,10 @@ final class ArcanistGoLintLinter extends ArcanistExternalLinter {
return pht('Install Golint using `go get github.com/golang/lint/golint`.');
}
public function shouldExpectCommandErrors() {
return false;
}
protected function canCustomizeLintSeverities() {
return true;
}

View file

@ -41,10 +41,6 @@ final class ArcanistHLintLinter extends ArcanistExternalLinter {
return '-';
}
public function shouldExpectCommandErrors() {
return true;
}
protected function getMandatoryFlags() {
return array('--json');
}

View file

@ -73,10 +73,6 @@ final class ArcanistJSHintLinter extends ArcanistExternalLinter {
return pht('Install JSHint using `npm install -g jshint`.');
}
public function shouldExpectCommandErrors() {
return true;
}
public function supportsReadDataFromStdin() {
return true;
}

View file

@ -47,10 +47,6 @@ final class ArcanistJSONLintLinter extends ArcanistExternalLinter {
return pht('Install jsonlint using `npm install -g jsonlint`.');
}
public function shouldExpectCommandErrors() {
return true;
}
public function supportsReadDataFromStdin() {
return true;
}

View file

@ -45,10 +45,6 @@ final class ArcanistJscsLinter extends ArcanistExternalLinter {
return pht('Install JSCS using `npm install -g jscs`.');
}
public function shouldExpectCommandErrors() {
return true;
}
protected function getMandatoryFlags() {
$options = array();

View file

@ -101,10 +101,6 @@ final class ArcanistLesscLinter extends ArcanistExternalLinter {
return pht('Install lessc using `npm install -g less`.');
}
public function shouldExpectCommandErrors() {
return true;
}
public function supportsReadDataFromStdin() {
// Technically `lessc` can read data from standard input however, when doing
// so, relative imports cannot be resolved. Therefore, this functionality is

View file

@ -70,10 +70,6 @@ final class ArcanistPEP8Linter extends ArcanistExternalLinter {
return pht('Install PEP8 using `easy_install pep8`.');
}
public function shouldExpectCommandErrors() {
return true;
}
protected function parseLinterOutput($path, $err, $stdout, $stderr) {
$lines = phutil_split_lines($stdout, false);

View file

@ -55,10 +55,6 @@ final class ArcanistPhpLinter extends ArcanistExternalLinter {
return $stdout;
}
public function shouldExpectCommandErrors() {
return true;
}
public function supportsReadDataFromStdin() {
return false;
}

View file

@ -68,10 +68,6 @@ final class ArcanistPhpcsLinter extends ArcanistExternalLinter {
}
}
public function shouldExpectCommandErrors() {
return true;
}
public function supportsReadDataFromStdin() {
return true;
}

View file

@ -52,10 +52,6 @@ final class ArcanistPuppetLintLinter extends ArcanistExternalLinter {
'gem install puppet-lint');
}
public function shouldExpectCommandErrors() {
return true;
}
protected function getMandatoryFlags() {
return array(
'--error-level=all',

View file

@ -53,10 +53,6 @@ final class ArcanistPyFlakesLinter extends ArcanistExternalLinter {
return pht('Install pyflakes with `pip install pyflakes`.');
}
public function shouldExpectCommandErrors() {
return true;
}
public function supportsReadDataFromStdin() {
return true;
}

View file

@ -54,10 +54,6 @@ final class ArcanistRubyLinter extends ArcanistExternalLinter {
return true;
}
public function shouldExpectCommandErrors() {
return true;
}
protected function getMandatoryFlags() {
// -w: turn on warnings
// -c: check syntax