3 ms·
> Is adding a function in a patch release a violation of semver? Yes. When you add a patch then increment the semver patch version number. When you add a publi
by jph 5y ago
> Is adding a function in a patch release a violation of semver?
Yes. When you add a patch then increment the semver patch version number. When you add a public function then increment the semver minor version and reset the semver patch version to 0.
If you're doing something else, then you're not doing semver, and IMHO you should highlight that to your users.
- ReleaseCandidat 5y ago> Yes Only if your version is greater than or equal to 1. Before that, you can do what you want. Major version zero (0.y.z) is for initial development. Anything MAY change at any time. The public API SHOULD NOT be considered stable. https://semver.org/#spec-item-4 https://semver.org/#spec-item-4
- ChrisSD 5y agoIt should be noted that Cargo (the Rust package manager) has slightly stricter requirements here: https://doc.rust-lang.org/cargo/reference/semver.html https://doc.rust-lang.org/cargo/reference/semver.html > Initial development releases starting with "0.y.z" can treat changes in "y" as a major release, and "z" as a minor release. "0.0.z" releases are always major changes. This is because Cargo uses the convention that only changes in the left-most non-zero component are considered incompatible. This makes it more useful for OSS that never seem to reach 1.0.
- ReleaseCandidat 5y agoBut `can treat` is not a requirement but a suggestion. This is exactly the same as semver's 'all bets are off'.
- pornel 5y agoIn Cargo it's not merely a suggestion, but actual implemented behavior. Cargo takes the first non-zero number as the major incompatible version, and this influences dependency resolution.
- fisf 5y agoAlso, adding functions (e.g. overloads with new types) can absolutely change runtime behaviour, break tests, etc. Depending on language.