]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Relax the version regex for `ArcanistFlake8Linter`.
authorJoshua Spence <josh@joshuaspence.com>
Sun, 18 May 2014 01:18:03 +0000 (18:18 -0700)
committerepriestley <git@epriestley.com>
Sun, 18 May 2014 01:18:03 +0000 (18:18 -0700)
Summary: As noticed by @epriestley in D9060, `flake8 --version` can emit a string like "2.0" rather than the expected "2.0.0".

Test Plan: Uninstalled my existing version of `flake8` (v2.1.0) and installed a prior version (`pip install flake8==2.0.0`). Ran `flake8 --version` and inspected the output.

Reviewers: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D9174

src/lint/linter/ArcanistFlake8Linter.php

index ef810efb1707e6fba3c359dca777450e441cd0a0..b98c8a6ea687fab2b0901d8fff057b7ce6596fec 100644 (file)
@@ -47,7 +47,7 @@ final class ArcanistFlake8Linter extends ArcanistExternalLinter {
     list($stdout) = execx('%C --version', $this->getExecutableCommand());
 
     $matches = array();
-    if (preg_match('/^(?P<version>\d+\.\d+\.\d+)\b/', $stdout, $matches)) {
+    if (preg_match('/^(?P<version>\d+\.\d+(?:\.\d+)?)\b/', $stdout, $matches)) {
       return $matches['version'];
     } else {
       return false;