Skip to content

Commit 64c017a

Browse files
docs: add version bump annotations to all commit type descriptions
Add SemVer version bump information to all commit type descriptions in the interactive prompt, info text, and writing commits documentation. Previously, only `feat` and `fix` indicated their SemVer correlation. Now `refactor` and `perf` explicitly state they correlate with PATCH, and `docs`, `style`, `test`, `build`, and `ci` explicitly state they do not trigger a version bump. This addresses the remaining task from issue #515 which requested that commit message instructions identify what version bump occurs with all change types. Closes #515 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent a4f625d commit 64c017a

File tree

3 files changed

+30
-21
lines changed

3 files changed

+30
-21
lines changed

commitizen/cz/conventional_commits/conventional_commits.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,49 +62,50 @@ def questions(self) -> list[CzQuestion]:
6262
},
6363
{
6464
"value": "docs",
65-
"name": "docs: Documentation only changes",
65+
"name": "docs: Documentation only changes. No version bump",
6666
"key": "d",
6767
},
6868
{
6969
"value": "style",
7070
"name": (
7171
"style: Changes that do not affect the "
7272
"meaning of the code (white-space, formatting,"
73-
" missing semi-colons, etc)"
73+
" missing semi-colons, etc). No version bump"
7474
),
7575
"key": "s",
7676
},
7777
{
7878
"value": "refactor",
7979
"name": (
8080
"refactor: A code change that neither fixes "
81-
"a bug nor adds a feature"
81+
"a bug nor adds a feature. Correlates with PATCH in SemVer"
8282
),
8383
"key": "r",
8484
},
8585
{
8686
"value": "perf",
87-
"name": "perf: A code change that improves performance",
87+
"name": "perf: A code change that improves performance. Correlates with PATCH in SemVer",
8888
"key": "p",
8989
},
9090
{
9191
"value": "test",
92-
"name": ("test: Adding missing or correcting existing tests"),
92+
"name": ("test: Adding missing or correcting existing tests. No version bump"),
9393
"key": "t",
9494
},
9595
{
9696
"value": "build",
9797
"name": (
9898
"build: Changes that affect the build system or "
99-
"external dependencies (example scopes: pip, docker, npm)"
99+
"external dependencies (example scopes: pip, docker, npm). "
100+
"No version bump"
100101
),
101102
"key": "b",
102103
},
103104
{
104105
"value": "ci",
105106
"name": (
106107
"ci: Changes to CI configuration files and "
107-
"scripts (example scopes: GitLabCI)"
108+
"scripts (example scopes: GitLabCI). No version bump"
108109
),
109110
"key": "c",
110111
},

commitizen/cz/conventional_commits/conventional_commits_info.txt

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,29 @@ fix: a commit of the type fix patches a bug in your codebase
77
feat: a commit of the type feat introduces a new feature to the codebase
88
(this correlates with MINOR in semantic versioning).
99

10+
refactor: a commit of the type refactor is a code change that neither
11+
fixes a bug nor adds a feature
12+
(this correlates with PATCH in semantic versioning).
13+
14+
perf: a commit of the type perf is a code change that improves performance
15+
(this correlates with PATCH in semantic versioning).
16+
1017
BREAKING CHANGE: a commit that has the text BREAKING CHANGE: at the beginning of
1118
its optional body or footer section introduces a breaking API change
1219
(correlating with MAJOR in semantic versioning).
1320
A BREAKING CHANGE can be part of commits of any type.
1421

15-
Others: commit types other than fix: and feat: are allowed,
16-
like chore:, docs:, style:, refactor:, perf:, test:, and others.
22+
Others: commit types other than fix:, feat:, refactor:, and perf: are allowed,
23+
like chore:, docs:, style:, test:, build:, ci:, and others.
24+
These types do not trigger a version bump by default.
1725

1826
We also recommend improvement for commits that improve a current
1927
implementation without adding a new feature or fixing a bug.
2028

2129
Notice these types are not mandated by the conventional commits specification,
2230
and have no implicit effect in semantic versioning (unless they include a BREAKING CHANGE).
2331

24-
A scope may be provided to a commits type, to provide additional contextual
32+
A scope may be provided to a commit's type, to provide additional contextual
2533
information and is contained within parenthesis, e.g., feat(parser): add ability to parse arrays.
2634

2735
<type>[optional scope]: <description>

docs/tutorials/writing_commits.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,24 +20,24 @@ The Conventional Commits specification follows this structure:
2020

2121
### Commit Types
2222

23-
Commit types categorize the nature of your changes. The most important types for semantic versioning are:
23+
Commit types categorize the nature of your changes. By default, Commitizen uses the [Angular Convention](https://github.com/angular/angular/blob/22b96b9/CONTRIBUTING.md#-commit-message-guidelines) commit types. The following types affect semantic versioning:
2424

2525
- **`feat`**: Introduces a new feature (correlates with **MINOR** version increment)
2626
- **`fix`**: Patches a bug (correlates with **PATCH** version increment)
27+
- **`refactor`**: A code change that neither fixes a bug nor adds a feature (correlates with **PATCH** version increment)
28+
- **`perf`**: A code change that improves performance (correlates with **PATCH** version increment)
2729

28-
Other commonly used types include:
30+
The following types do **not** trigger a version bump by default:
2931

30-
- **`docs`**: Documentation only changes
31-
- **`style`**: Code style changes (formatting, missing semicolons, etc.)
32-
- **`refactor`**: Code refactoring without changing functionality
33-
- **`perf`**: Performance improvements
34-
- **`test`**: Adding or updating tests
35-
- **`build`**: Changes to build system or dependencies
36-
- **`ci`**: Changes to CI configuration files
37-
- **`chore`**: Other changes that don't modify source or test files
32+
- **`docs`**: Documentation only changes (no version bump)
33+
- **`style`**: Code style changes such as formatting, missing semicolons, etc. (no version bump)
34+
- **`test`**: Adding or updating tests (no version bump)
35+
- **`build`**: Changes to build system or dependencies (no version bump)
36+
- **`ci`**: Changes to CI configuration files (no version bump)
37+
- **`chore`**: Other changes that don't modify source or test files (no version bump)
3838

3939
!!! note
40-
While `feat` and `fix` directly affect semantic versioning, other types (like `build`, `chore`, `docs`) typically don't trigger version bumps unless they include a `BREAKING CHANGE`.
40+
Only `feat`, `fix`, `refactor`, and `perf` trigger version bumps by default. All other types (like `docs`, `style`, `test`, `build`, `ci`, `chore`) do not trigger version bumps unless they include a `BREAKING CHANGE`. You can customize this behavior through the [bump_map configuration](../customization/config_file.md).
4141

4242
### Breaking Changes
4343

0 commit comments

Comments
 (0)