node-semver
node-semver copied to clipboard
CLI accepts invalid increment specifiers with -i/--increment and treats them as 'patch'
E.g.:
semver -i nonesuch 1.0.0
outputs 1.0.1 and sets exit code to 0; i.e., it acts as if patch (or no argument) had been specified.
This is working by design. The default value of -i is patch and invalid versions are filtered out of the input.
Quietly accepting invalid input is problematic.
Another way of putting it: if this is by design, please reconsider the design.
Consider reporting an error if an invalid -i argument is specified.
@mklement0 Thanks for the feedback. I closed this issue as a first pass through this repo, so maybe "by design" was the wrong choice of words. The code makes it clear that any invalid values passed to -i are ignored but I agree that erroring is a good idea.
For this project I believe in a very cautious approach to versioning, so I think this would be a breaking change so I'm going to tag it as such. I don't have any immediate plans to release a major version but surfacing this as a breaking change will help to batch this in when it's time.