Feature: fixes issue #20 by adding support for cargo - #48
georgbramm wants to merge 24 commits into
Conversation
|
Thank you for you contribution, I'll get to reviewing this later 👍 |
tziemek
left a comment
There was a problem hiding this comment.
I think we should clarify the usage of type specific comparators in vers strings before continuing the PRs for the additional types.
This would then lead to a simpler parsing of the version range, because the type specific version comparators would only be relevant for the from_native functions and not for general validation or contains checks.
| fn from_native(raw: &str) -> Result<Vec<VersionConstraint<Self>>, VersError> { | ||
| if raw.bytes().any(|b| b == b'\t' || b == b'\n' || b == b'\r') { | ||
| return Err(VersError::InvalidConstraint( | ||
| "Literal whitespace not allowed".to_string(), |
There was a problem hiding this comment.
We should probably have a better error message here. These are not strictly whitespaces and whitespaces should be allowed in native strings. NPM for example, needs them to represent version ranges.
There was a problem hiding this comment.
i updated the error message in 7864096 to be more precise.
|
Do you plan to fix the usage of |
I try to fix it in this PR |
|
|
tziemek
left a comment
There was a problem hiding this comment.
Priority 1, as those are needed for CSAF:
- Fix JSON round trip
- Fix prerelease ordering
Priority 2:
- fix native parsing
We can also leave native parsing open for the moment, but we should then add some info to the readme that it is not working correctly, would be fine with me.
| /// detecting the versioning scheme and constructing the appropriate typed | ||
| /// version range internally. | ||
| /// | ||
| ///impl<'de> serde::de::Deserialize<'de> for DynamicVersionRange { |
There was a problem hiding this comment.
That's some stray text in the comment
| ///impl<'de> serde::de::Deserialize<'de> for DynamicVersionRange { | |
| /// |
There was a problem hiding this comment.
Maybe we could also use https://crates.io/crates/debversion here?
There was a problem hiding this comment.
i will check it out tomorrow and continue the integration using the mentioned crates
…rsion and align test suite
Covers every core component of Cargo's dependency specification syntax, hopefully =)
Addresses Add support for
cargo#20