andrew / andrew/vers

Cargo native ranges with comma-separated comparators are rejected in 2.0

Open Beginner friendly
#37 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Ruby
Stars
13
Forks
0
Avg merge
8h 16m
Merged PRs (30d)
4

Description

Cargo's documented version-requirement syntax uses a comma to AND comparators:

> Multiple version requirements can be separated with a comma, e.g., `>= 1.2, < 1.5`.

https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#multiple-requirements

vers 2.0 routes `cargo` through `parse_npm_range`, which only splits on whitespace and rejects tokens with a trailing comma:

```ruby
Vers.satisfies?("2.1.0", ">= 2.1.0, < 2.41.0", "cargo")
# => ArgumentError: Invalid NPM range format: >=2.1.0,
```

vers 1.3.1 accepted this. `parse_npm_range` should either strip/split on commas when `scheme: "cargo"`, or cargo should get its own parser that treats `,` as the AND separator.

Contributor guide

Open the contributing guide

Research direction

Start by locating parse_npm_range and the code path that routes Cargo ranges through it. Reproduce the documented comma-separated requirement example, then add coverage for Cargo's comma-separated comparators and verify that the range is accepted without breaking existing NPM parsing.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby, rust
Domain
tooling
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
74/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.