Skip to content

Commit

Permalink
Support multiple comma-separated 'extras' (#65)
Browse files Browse the repository at this point in the history
This regular expression previously only supported a single 'extra', but
multiple 'extras' can be specified when separated by commas.
  • Loading branch information
jparise authored Mar 11, 2021
1 parent b96ab36 commit ed6d4f3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/PythonRequirementsLinter.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function getLintNameMap() {

private function parseRequirement($line) {
# PEP 508 (https://www.python.org/dev/peps/pep-0508/)
$regex = "/^(?P<name>[[:alnum:]][[:alnum:]\-_.]*(?:\[[[:alnum:]]+\])?)".
$regex = "/^(?P<name>[[:alnum:]][[:alnum:]\-_.]*(?:\[[[:alnum:],]+\])?)".
"(?:\s*(?P<cmp>(~=|==|!=|<=|>=|<|>|===))\s*".
"(?P<version>[[:alnum:]\-_.*+!]+))?".
"(?:\s*;\s*(?P<environment>[^#]*))?/";
Expand Down

0 comments on commit ed6d4f3

Please sign in to comment.