Changeset View
Changeset View
Standalone View
Standalone View
src/lint/linter/ArcanistJSHintLinter.php
Context not available. | |||||
} | } | ||||
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)) { | } else if (@preg_match('/^E043$/', $code)) { | ||||
// TODO: If JSHint encounters a large number of errors, it will quit | // TODO: If JSHint encounters a large number of errors, it will quit | ||||
// prematurely and add an additional "Too Many Errors" error. Ideally, we | // prematurely and add an additional "Too Many Errors" error. Ideally, we | ||||
// should be able to pass some sort of `--force` option to `jshint`. | // should be able to pass some sort of `--force` option to `jshint`. | ||||
Context not available. | |||||
$matches = array(); | $matches = array(); | ||||
$regex = '/^jshint v(?P<version>\d+\.\d+\.\d+)$/'; | $regex = '/^jshint v(?P<version>\d+\.\d+\.\d+)$/'; | ||||
if (preg_match($regex, $stderr, $matches)) { | if (@preg_match($regex, $stderr, $matches)) { | ||||
return $matches['version']; | return $matches['version']; | ||||
} else { | } else { | ||||
return false; | return false; | ||||
Context not available. | |||||
} | } | ||||
protected function getLintCodeFromLinterConfigurationKey($code) { | protected function getLintCodeFromLinterConfigurationKey($code) { | ||||
if (!preg_match('/^(E|W)\d+$/', $code)) { | if (!@preg_match('/^(E|W)\d+$/', $code)) { | ||||
throw new Exception( | throw new Exception( | ||||
pht( | pht( | ||||
'Unrecognized lint message code "%s". Expected a valid JSHint '. | 'Unrecognized lint message code "%s". Expected a valid JSHint '. | ||||
Context not available. |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0