naneau / semver

PHP Semantic Versioning library
MIT License
73 stars 9 forks source link

detect and remove leading 'v' and pad missing version components #7

Open burn2delete opened 10 years ago

burn2delete commented 10 years ago

the library should look for a leading 'v' ex. 'v.1.2.3' and remove it (since it's not part of the standard) also pading 0 for missing version parts ex. (1.3 becomes 1.3.0, 2 becomes 2.0 or 2.0.0)

naneau commented 10 years ago

That's not a bad idea. I want to have it be more in line with the versions as they are used by Composer. X.Y is not a valid SemVer, but I suppose you are right in saying X.Y.0 was probably meant.

naneau commented 10 years ago

The main problem here is being standards compliant. Perhaps there's room for a "soft" interpreter, that fixes mistakes that have a probable fix, next to the current, rather harsh one.

burn2delete commented 10 years ago

Agreed, an optional flag could switch to a much loser pregmatch.

Matthew Ratzke

On Jun 17, 2014, at 11:07, Maurice Fonk notifications@github.com wrote:

The main problem here is being standards compliant. Perhaps there's room for a "soft" interpreter, that fixes mistakes that have a probable fix, next to the current, rather harsh one.

— Reply to this email directly or view it on GitHub.