From 6dadb6b48c9fbc81dc840d4dc1f78af98c99aacf Mon Sep 17 00:00:00 2001 From: cburroughs Date: Tue, 10 Feb 2015 06:17:25 -0800 Subject: [PATCH] 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 --- src/lint/linter/ArcanistPEP8Linter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lint/linter/ArcanistPEP8Linter.php b/src/lint/linter/ArcanistPEP8Linter.php index 82ab607f..03811358 100644 --- a/src/lint/linter/ArcanistPEP8Linter.php +++ b/src/lint/linter/ArcanistPEP8Linter.php @@ -59,7 +59,7 @@ final class ArcanistPEP8Linter extends ArcanistExternalLinter { list($stdout) = execx('%C --version', $this->getExecutableCommand()); $matches = array(); - if (preg_match('/^(?P\d+\.\d+\.\d+)$/', $stdout, $matches)) { + if (preg_match('/^(?P\d+\.\d+(?:\.\d+)?)\b/', $stdout, $matches)) { return $matches['version']; } else { return false;