1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-22 14:52:40 +01:00

Skip the "Too Many Errors" error that is raised by JSHint.

Summary: If JSHint encounters //too many// errors (by default, more than 50) errors, then it quits prematurely and raises an additional (rather unhelpful) "Too Many Errors" error. We should just ignore this additional error.

Test Plan: Added a test case.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9693
This commit is contained in:
Joshua Spence 2014-06-24 04:16:15 +10:00
parent 48d62ed444
commit 213628ff34
2 changed files with 12 additions and 0 deletions

View file

@ -31,6 +31,13 @@ final class ArcanistJSHintLinter extends ArcanistExternalLinter {
protected function getDefaultMessageSeverity($code) { protected function getDefaultMessageSeverity($code) {
if (preg_match('/^W/', $code)) { if (preg_match('/^W/', $code)) {
return ArcanistLintSeverity::SEVERITY_WARNING; return ArcanistLintSeverity::SEVERITY_WARNING;
} else if (preg_match('/^E043$/', $code)) {
// TODO: If JSHint encounters a large number of errors, it will quit
// prematurely and add an additional "Too Many Errors" error. Ideally, we
// should be able to pass some sort of `--force` option to `jshint`.
//
// See https://github.com/jshint/jshint/issues/180
return ArcanistLintSeverity::SEVERITY_DISABLED;
} else { } else {
return ArcanistLintSeverity::SEVERITY_ERROR; return ArcanistLintSeverity::SEVERITY_ERROR;
} }

View file

@ -0,0 +1,5 @@
/* jshint maxerr: 1 */
console.log('foobar')
~~~~~~~~~~
disabled:2:22
warning:2:22