Changeset View
Changeset View
Standalone View
Standalone View
src/lint/linter/ArcanistPyFlakesLinter.php
| Show First 20 Lines • Show All 61 Lines • ▼ Show 20 Lines | foreach ($lines as $line) { | ||||
| $severity = ArcanistLintSeverity::SEVERITY_WARNING; | $severity = ArcanistLintSeverity::SEVERITY_WARNING; | ||||
| $description = $matches[3]; | $description = $matches[3]; | ||||
| $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; | ||||
| } | } | ||||
| $message = new ArcanistLintMessage(); | $message = id(new ArcanistLintMessage()) | ||||
| $message->setPath($path); | ->setPath($path) | ||||
| $message->setLine($matches[2]); | ->setLine($matches[2]) | ||||
| $message->setCode($this->getLinterName()); | ->setDescription($description) | ||||
| $message->setDescription($description); | ->setSeverity($severity); | ||||
| $message->setSeverity($severity); | |||||
| $messages[] = $message; | $messages[] = $message; | ||||
| } | } | ||||
| return $messages; | return $messages; | ||||
| } | } | ||||
| protected function canCustomizeLintSeverities() { | |||||
| return false; | |||||
| } | |||||
| } | } | ||||