Content to be added or fixed
See original GitHub issueType
- Content inaccurate
URL
https://commitizen-tools.github.io/commitizen/bump/
Description
Problem
The docs state “fix
+everything else” bumps PATCH
of the version string per the default commit_map
.
However, this is not the case:
Only fix
, refactor
, and perf
bump PATCH
, leaving out docs
, style
, test
, build
, and ci
, which don’t bump any part of the version.
Not only are the docs incorrect, but this is out of step with Conventional Commits 1.0.0. Additional commit types are permitted by the specification (e.g. commitizen
appears to be using the Angular Convention by default), but no guidance on version bumping is given for these addition types. Where a commit type bumps or does not bump a version, this should be explicitly stated (e.g. the commit message instructions for fix
has Correlates with PATCH in SemVer
, but not refactor
or perf
, leaving one to believe these do nothing).
Recommendations:
-
(PREFERRED; Conventional Commit spec): Only
feature
andfix
should be in the defaultcommit_map
per Conventional Commits 1.0.0.refactor
andperf
should not bumpPATCH
. The Angular typesrefactor
,perf
,docs
,style
,test
,build
, andci
should be removed from the default commit types. -
(ALTERNATIVE; Angular Convention, but with explicit messaging):
refactor
andperf
should not bumpPATCH
. The commit message instructions forrefactor
,perf
,docs
,style
,test
,build
, andci
should addCorrelates with no version bump in SemVer
. In addition, the docs should clearly state the Angular Convention commit types are included incz c
by default.
Tasks:
- Correct the documentation (state what change types bump versions and that commitizen includes Angular Convention types by default)
- Add notes in commit message instructions to identify what version bump occurs with all change types (e.g. Correlates with no version bump in SemVer)
Issue Analytics
- State:
- Created a year ago
- Comments:10 (10 by maintainers)
Top GitHub Comments
@woile @Lee-W I’ve had some time to investigate and practice with
semver
and found some additional articles that have changed my opinions a bit.The following are several great articles related to semantic versioning (perhaps well-known by now):
These articles opened my eyes to Hyrum’s Law, which indicates you cannot guarantee a priori what changes will break end-user code. You can only guarantee what changes will break your API (i.e. how you claim your library is intended to be used) up to the tests contained within your test suite. This has significant implications for dependency managers (like
poetry
) that implicitly rely onsemver
being a reliable outward-facing contract to end-users to identify what will break their code.The above has been a source of tension in the community:
poetry
binds major versions, which was quite a divisive choice on the developers’ part (consequences of pinning major versions is explained in Hynek’s article).The comment I like the most is Brett Cannon’s epiphany:
What is understated here is that the community implicitly understands major versions to be long-lived branches. When a
v1
is released, the implicit statement to end users is:I believe the
commitizen
documentation should make explicit thatsemver
cannot guarantee whether or not a different version of installed software will break end-user code, but the notions ofBREAKING
,feat
,fix
, etc., should be understood within the context of the library by itself, without other libraries, as tested by the project test suite.For example, this is how library maintainers should treat the following and understand their end-user contract to be:
Donald states this well:
Additional Excellent Points
Hynek:
@Lee-W @Woile Lastly, I also want to say “THANK YOU!!!” for this great package! 🎉
Below is my
pyproject.toml
using standardcommitizen
(no emojis) that meets what I’ve been talking about above (it would be nice to add a section to your docs containing third-party config files, in addition to 3rd-party packages, since not everyone will want to make a package; granted, some things require a plugin and not everything can be done through a config file). Some things worth noting:Version
2.20.0
does not have thecommit_parser
option, which is necessary forCHANGELOG.md
to be properly rendered. Your docs don’t have a version attached to them, so I am only able to see docs for the latest version (important, say, for those reverting to version2.20.0
due to Issue #510 ). So, I bumped back up to2.27.0
.It would be nice to have an option added that generates a
CHANGELOG.md
header (withmarkdownlint
without a header, you get anMD041
error. This is what I have (borrowed fromKeep a Changelog
):commitizen_emoji
without having to create a separate plugin.My TOML Configuration: