Skip to content

Commit 8b05e9f

Browse files
committed
feat: update default changelog titles
1 parent 8cc46cd commit 8b05e9f

File tree

2 files changed

+26
-4
lines changed

2 files changed

+26
-4
lines changed

commitizen/cz/conventional_commits/conventional_commits.py

+11-4
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,18 @@ class ConventionalCommitsCz(BaseCommitizen):
3333
bump_map_major_version_zero = defaults.bump_map_major_version_zero
3434
commit_parser = r"^((?P<change_type>feat|fix|refactor|perf|BREAKING CHANGE)(?:\((?P<scope>[^()\r\n]*)\)|\()?(?P<breaking>!)?|\w+!):\s(?P<message>.*)?" # noqa
3535
change_type_map = {
36-
"feat": "Feat",
37-
"fix": "Fix",
38-
"refactor": "Refactor",
39-
"perf": "Perf",
36+
"feat": "New features",
37+
"fix": "Bug fixes",
38+
"refactor": "Code refactoring",
39+
"perf": "Performance improvements",
4040
}
41+
change_type_order = [
42+
"BREAKING CHANGE",
43+
"New features",
44+
"Bug fixes",
45+
"Code refactoring",
46+
"Performance improvements",
47+
]
4148
changelog_pattern = defaults.bump_pattern
4249

4350
def questions(self) -> Questions:

tests/conftest.py

+15
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
from commitizen.config import BaseConfig
1818
from commitizen.cz import registry
1919
from commitizen.cz.base import BaseCommitizen
20+
from commitizen.cz.conventional_commits import ConventionalCommitsCz
2021
from tests.utils import create_file_and_commit
2122

2223
SIGNER = "GitHub Action"
@@ -253,3 +254,17 @@ def any_changelog_format(config: BaseConfig) -> ChangelogFormat:
253254
"""For test not relying on formats specifics, use the default"""
254255
config.settings["changelog_format"] = defaults.CHANGELOG_FORMAT
255256
return get_changelog_format(config)
257+
258+
259+
@pytest.fixture(autouse=True)
260+
def default_change_type_map(mocker: MockerFixture) -> None:
261+
mocker.patch.object(
262+
ConventionalCommitsCz,
263+
"change_type_map",
264+
{
265+
"feat": "Feat",
266+
"fix": "Fix",
267+
"refactor": "Refactor",
268+
"perf": "Perf",
269+
},
270+
)

0 commit comments

Comments
 (0)