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

losen pep8 version check

Summary:
pep8 has used both 2 (`1.2`) and 3 (`1.2.1`) digit versions.  Losen
the version check to allow for both.

NOTE: This is the same regex as flake8.

Test Plan: `arc unit` with a 2 and 3 digit pep8 version on `$PATH`.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: joshuaspence, epriestley

Differential Revision: https://secure.phabricator.com/D11728
This commit is contained in:
cburroughs 2015-02-10 06:17:25 -08:00 committed by epriestley
parent 17ec3859cd
commit 6dadb6b48c

View file

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