From: Joshua Spence Date: Sun, 18 May 2014 01:18:03 +0000 (-0700) Subject: Relax the version regex for `ArcanistFlake8Linter`. X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=b4b6a33d2a8d80aebe7ce87e98e007ca75d87b91;p=arcanist.git Relax the version regex for `ArcanistFlake8Linter`. 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 --- diff --git a/src/lint/linter/ArcanistFlake8Linter.php b/src/lint/linter/ArcanistFlake8Linter.php index ef810efb..b98c8a6e 100644 --- a/src/lint/linter/ArcanistFlake8Linter.php +++ b/src/lint/linter/ArcanistFlake8Linter.php @@ -47,7 +47,7 @@ final class ArcanistFlake8Linter extends ArcanistExternalLinter { list($stdout) = execx('%C --version', $this->getExecutableCommand()); $matches = array(); - if (preg_match('/^(?P\d+\.\d+\.\d+)\b/', $stdout, $matches)) { + if (preg_match('/^(?P\d+\.\d+(?:\.\d+)?)\b/', $stdout, $matches)) { return $matches['version']; } else { return false;