pinterest / arcanist-linters

A collection of custom Arcanist linters
Apache License 2.0
63 stars 45 forks source link

Support package environment markers #17

Closed jparise closed 5 years ago

jparise commented 5 years ago

Environment markers can be added at the end of a package requirement line following a semicolon. For example:

Django==1.5.4; python_version < '3'

Teach the parser to recognize this part of the requirements grammar and use it to allow duplicate package names that have different requirements. For example, this is now valid:

Django==1.5.4; python_version < '3'
Django==1.11.18; python_version >= '3'

Also, adjust the "unsorted" rule to allow duplicate package names but enforce the sort order of their version strings.