fix(conventional_commits): add missing version bump notes for all change types#1960
Open
bearomorphism wants to merge 1 commit intocommitizen-tools:masterfrom
Open
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1960 +/- ##
=======================================
Coverage 98.23% 98.23%
=======================================
Files 61 61
Lines 2779 2779
=======================================
Hits 2730 2730
Misses 49 49 ☔ View full report in Codecov by Sentry. |
6e7b54a to
eb1a4b8
Compare
…nge types Closes commitizen-tools#515 * Update the cz commit prompt to state the version bump impact for every Conventional Commit type, matching the existing 'Correlates with X in SemVer' phrasing already used for fix and feat: - refactor, perf -> 'Correlates with PATCH in SemVer' - docs, style, test, build, ci -> 'Correlates with no version bump in SemVer' * Update conventional_commits_info.txt to call out commitizen's defaults on top of the Conventional Commits specification. * Add a 'Recommended Reading on Versioning' section in docs/external_links.md with the articles surfaced in the issue discussion (Hynek, Brett Cannon, Donald Stufft, Hyrum's Law, 0ver, CalVer, PEP 440) and cross-link it from docs/commands/bump.md. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
eb1a4b8 to
1242932
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Closes #515
Adds explicit version-bump documentation for every Conventional Commit type, both in the interactive
cz commitprompt and in thecz infooutput, so users can immediately see how each type affects semantic versioning under Commitizen's defaults. Also adds a "Recommended Reading on Versioning" docs section gathering the articles surfaced during the issue discussion.The first task in the issue (fixing the inaccurate "fix + everything else" rule in the bump docs) was already addressed by #1452. This PR completes the remaining tasks:
Correlates with no version bump in SemVer)What changed
commitizen/cz/conventional_commits/conventional_commits.py— every prompt choice now spells out its version-bump impact, using theCorrelates with X in SemVerphrasing already established byfixandfeat:fix,feat(unchanged): already correlated with PATCH/MINORrefactor,perf: "Correlates with PATCH in SemVer"docs,style,test,build,ci: "Correlates with no version bump in SemVer"Reflects the actual default
bump_map(per @woile's comment: "fix, refactor and perf are patch, not everything"), not the alternative spec-only mapping.commitizen/cz/conventional_commits/conventional_commits_info.txt— clarifies that, on top of the Conventional Commits spec, Commitizen's defaults bump PATCH forrefactorandperf, and don't bump fordocs/style/test/build/ci. Notes that this can be customized viabump_map/bump_pattern.docs/external_links.md— new "Recommended Reading on Versioning" section linking the articles cited by @adam-grant-hendry: Hynek's Semantic Versioning Will Not Save You, Brett Cannon's Why I don't like SemVer anymore, Donald Stufft's Versioning Software, Hyrum's Law, 0ver, CalVer, PEP 440, plus the Conventional Commits / SemVer specs.docs/commands/bump.md— adds a clarifying sentence under the Version Increment Rules table for non-bumping types, plus atipadmonition cross-linking to the new reading list.Checklist
Was generative AI tooling used to co-author this PR?
Generated-by: GitHub Copilot CLI following the guidelines
Code Changes
uv run poe alllocally to ensure this change passes linter check and testspoe lint(ruff + mypy): cleantest_cz_conventional_commits.py,test_cz_search_filter.py,test_check_command.py,test_commit_command.py,test_cz_customize.py): 161 passedmasterwithout these changes.Documentation Changes
uv run poe doclocally to ensure the documentation pages renders correctly (mkdocs buildclean)external_links.md#recommended-reading-on-versioningverified in the rendered site.Expected Behavior
Running
cz commitshows the version-bump impact next to every change type, e.g.:cz infonow also calls out Commitizen's defaults explicitly.Steps to Test This Pull Request
uv sync --frozen --group base --group test --group linters --group documentationuv run cz commit— observe the new version-bump notes in the change-type prompt.uv run cz info— observe the new paragraph clarifying Commitizen's defaults.uv run poe doc— visitexternal_links.mdandcommands/bump.mdto verify the new section and cross-link render correctly.Additional Context