1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-10 00:42:40 +01:00

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
This commit is contained in:
Joshua Spence 2014-05-17 18:18:03 -07:00 committed by epriestley
parent 7c56fad48f
commit b4b6a33d2a

View 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;