]> khamidou — GitHub mirrors - arcanist.git/commitdiff
support newer PyLint column numbers
authorChris Piro <cpiro@airtime.com>
Thu, 27 Oct 2011 22:37:45 +0000 (15:37 -0700)
committerChris Piro <cpiro@airtime.com>
Mon, 31 Oct 2011 20:53:09 +0000 (13:53 -0700)
Summary: newer PyLint includes commas and a column number for every message
after the line number. ignore that if it's present.

Test Plan: ##arc lint --trace --lintall## a file with messages with the old and
new pylint (2.5), works fine with both

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, epriestley
Differential Revision: 1062

src/lint/linter/pylint/ArcanistPyLintLinter.php

index 5f452345909f806ef22a4abf8219da116cfea90a..51c48fdd18a2489a749285367b406bf077bf1a0b 100644 (file)
@@ -238,7 +238,9 @@ class ArcanistPyLintLinter extends ArcanistLinter {
     $messages = array();
     foreach ($lines as $line) {
       $matches = null;
-      if (!preg_match('/([A-Z]\d+): *(\d+): *(.*)$/', $line, $matches)) {
+      if (!preg_match(
+              '/([A-Z]\d+): *(\d+)(?:|,\d*): *(.*)$/',
+              $line, $matches)) {
         continue;
       }
       foreach ($matches as $key => $match) {