Changeset View
Changeset View
Standalone View
Standalone View
src/lint/linter/ArcanistPyLintLinter.php
Context not available. | |||||
$matches = array(); | $matches = array(); | ||||
$regex = '/^pylint (?P<version>\d+\.\d+\.\d+)/'; | $regex = '/^pylint (?P<version>\d+\.\d+\.\d+)/'; | ||||
if (preg_match($regex, $stdout, $matches)) { | if (@preg_match($regex, $stdout, $matches)) { | ||||
return $matches['version']; | return $matches['version']; | ||||
} else { | } else { | ||||
return false; | return false; | ||||
Context not available. | |||||
$messages = array(); | $messages = array(); | ||||
foreach ($lines as $line) { | foreach ($lines as $line) { | ||||
$matches = explode('|', $line, 5); | $matches = @explode('|', $line, 5); | ||||
if (count($matches) < 5) { | if (count($matches) < 5) { | ||||
continue; | continue; | ||||
Context not available. | |||||
} | } | ||||
protected function getDefaultMessageSeverity($code) { | protected function getDefaultMessageSeverity($code) { | ||||
switch (substr($code, 0, 1)) { | switch (@substr($code, 0, 1)) { | ||||
case 'R': | case 'R': | ||||
case 'C': | case 'C': | ||||
return ArcanistLintSeverity::SEVERITY_ADVICE; | return ArcanistLintSeverity::SEVERITY_ADVICE; | ||||
Context not available. | |||||
} | } | ||||
protected function getLintCodeFromLinterConfigurationKey($code) { | protected function getLintCodeFromLinterConfigurationKey($code) { | ||||
if (!preg_match('/^(R|C|W|E|F)\d{4}$/', $code)) { | if (!@preg_match('/^(R|C|W|E|F)\d{4}$/', $code)) { | ||||
throw new Exception( | throw new Exception( | ||||
pht( | pht( | ||||
'Unrecognized lint message code "%s". Expected a valid Pylint '. | 'Unrecognized lint message code "%s". Expected a valid Pylint '. | ||||
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