Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 34543d5

Browse files
committed
feat: update default changelog titles
1 parent ffb26fb commit 34543d5

File tree

2 files changed

+26
-4
lines changed

2 files changed

+26
-4
lines changed

‎commitizen/cz/conventional_commits/conventional_commits.py‎

Lines changed: 11 additions & 4 deletions
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‎

Lines changed: 15 additions & 0 deletions
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)

AltStyle によって変換されたページ (->オリジナル) /