diff --git a/src/lint/linter/ArcanistPyFlakesLinter.php b/src/lint/linter/ArcanistPyFlakesLinter.php --- a/src/lint/linter/ArcanistPyFlakesLinter.php +++ b/src/lint/linter/ArcanistPyFlakesLinter.php @@ -35,7 +35,7 @@ list($stdout) = execx('%C --version', $this->getExecutableCommand()); $matches = array(); - if (preg_match('/^(?P\d+\.\d+\.\d+)$/', $stdout, $matches)) { + if (preg_match('/^(?P\d+\.\d+\.\d+)( Python.*)?$/', $stdout, $matches)) { return $matches['version']; } else { return false; @@ -52,7 +52,10 @@ $messages = array(); foreach ($lines as $line) { $matches = null; - if (!preg_match('/^(.*?):(\d+): (.*)$/', $line, $matches)) { + if (!preg_match( + '/^(?.*?):(?\d+):(?\d*) (?.*)$/', + $line, + $matches)) { continue; } foreach ($matches as $key => $match) { @@ -60,7 +63,7 @@ } $severity = ArcanistLintSeverity::SEVERITY_WARNING; - $description = $matches[3]; + $description = $matches['message']; $error_regexp = '/(^undefined|^duplicate|before assignment$)/'; if (preg_match($error_regexp, $description)) { @@ -69,7 +72,10 @@ $message = new ArcanistLintMessage(); $message->setPath($path); - $message->setLine($matches[2]); + $message->setLine($matches['line']); + if ($matches['column'] != '') { + $message->setChar($matches['column']); + } $message->setCode($this->getLinterName()); $message->setName($this->getLinterName()); $message->setDescription($description); diff --git a/src/lint/linter/__tests__/pyflakes/pyflakes.lint-test b/src/lint/linter/__tests__/pyflakes/pyflakes.lint-test --- a/src/lint/linter/__tests__/pyflakes/pyflakes.lint-test +++ b/src/lint/linter/__tests__/pyflakes/pyflakes.lint-test @@ -2,6 +2,6 @@ x += 1 ~~~~~~~~~~ -warning:1:0 -warning:1:0 -error:3:0 +warning:1: +warning:1: +error:3: