Standard: SemVer
Semantic Versioning 2.0.0: versions in manifests and release tags are valid, a breaking change raises the major; three norms and a hint for the next version from commits.
Standard: SemVer
What the standard is. Semantic Versioning 2.0.0 is the rules for a version number MAJOR.MINOR.PATCH. The text: https://semver.org/spec/v2.0.0.html. A breaking change to the public API raises the major, a new backward-compatible feature raises the minor, a fix raises the patch. A pre-release is written with a hyphen (1.0.0-rc.1), build metadata with a plus (1.0.0+20261128). While the major is 0, the API may change in any way (item 4).
When to install. The project has releases or packages with a version that someone relies on: a library, a tool, the standard's packages. We learn of breaking changes from Conventional Commits (! in the header or a BREAKING CHANGE footer), so the package sits well next to std-conventional-commits.
How to configure. The page /norms/standards/semver.md: which manifests to look at (manifests), what to skip (exclude, by default fixtures and archives), where the version of the whole project is (versionFile, by default the first manifest in the root), the prefix of release tags (tagPrefix, v by default), what a breaking change raises while the major is 0 (zeroMajor: minor or major). A hint: shtuk run std-semver next gives the project version, the last release and the next version from commits.
What is checked
- SV-R01 (MUST, enforce): the version in
package.json,Cargo.toml([package],[workspace.package]),pyproject.toml([project],[tool.poetry]) andpackage.md(a Shtukbase package) is valid SemVer 2.0.0. The check is the regular expression from the standard itself. A manifest without a version (a privatepackage.json, a workspace member, a dynamic version) is not checked. Thevalidcheck. - SV-R02 (MUST, observe): after the last release tag, a breaking commit raises the major (while the major is 0, the minor), and the project version is not lower than the last release. It observes: a version is often raised at the moment of release, not at the moment of the commit. The
breakingcheck. - SV-R03 (SHOULD, enforce): a tag that looks like a release (
vand a digit) carries a valid version:v1.2orv1.2.3.4is a finding. Thetagscheck.
What is not checked
- What a project's public API is and whether a change is really breaking: a person decides this (item 1 of the standard). The package trusts the commits.
- Versions of dependencies and ranges (
^1.2.0): these are not the project's version. pyproject.tomlby PEP 440 (1.0rc1) does not conform to SemVer; such a project removespyproject.tomlfrommanifests.- Released content under a version does not change (item 3): that is the history of the registry, not of files.
The package only reads git (git tag, git log). It writes nothing.