Changeset View
Changeset View
Standalone View
Standalone View
src/lint/linter/ArcanistPyFlakesLinter.php
Context not available. | |||||
$matches = array(); | $matches = array(); | ||||
$pattern = '/^(?P<version>\d+\.\d+\.\d+)( Python.*)?$/'; | $pattern = '/^(?P<version>\d+\.\d+\.\d+)( Python.*)?$/'; | ||||
if (preg_match($pattern, $stdout, $matches)) { | if (@preg_match($pattern, $stdout, $matches)) { | ||||
return $matches['version']; | return $matches['version']; | ||||
} else { | } else { | ||||
return false; | return false; | ||||
Context not available. | |||||
foreach ($lines as $line) { | foreach ($lines as $line) { | ||||
$matches = null; | $matches = null; | ||||
$pattern = '/^(?<path>.*?):(?<line>\d+):(?<column>\d*) (?<message>.*)$/'; | $pattern = '/^(?<path>.*?):(?<line>\d+):(?<column>\d*) (?<message>.*)$/'; | ||||
if (!preg_match($pattern, $line, $matches)) { | if (!@preg_match($pattern, $line, $matches)) { | ||||
continue; | continue; | ||||
} | } | ||||
foreach ($matches as $key => $match) { | foreach ($matches as $key => $match) { | ||||
Context not available. | |||||
$description = $matches['message']; | $description = $matches['message']; | ||||
$error_regexp = '/(^undefined|^duplicate|before assignment$)/'; | $error_regexp = '/(^undefined|^duplicate|before assignment$)/'; | ||||
if (preg_match($error_regexp, $description)) { | if (@preg_match($error_regexp, $description)) { | ||||
$severity = ArcanistLintSeverity::SEVERITY_ERROR; | $severity = ArcanistLintSeverity::SEVERITY_ERROR; | ||||
} | } | ||||
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