File tree Expand file tree Collapse file tree 2 files changed +26
-4
lines changed
commitizen/cz/conventional_commits Expand file tree Collapse file tree 2 files changed +26
-4
lines changed Original file line number Diff line number Diff line change @@ -33,11 +33,18 @@ class ConventionalCommitsCz(BaseCommitizen):
33
33
bump_map_major_version_zero = defaults.bump_map_major_version_zero
34
34
commit_parser = r"^((?P<change_type>feat|fix|refactor|perf|BREAKING CHANGE)(?:\((?P<scope>[^()\r\n]*)\)|\()?(?P<breaking>!)?|\w+!):\s(?P<message>.*)?" # noqa
35
35
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 ",
40
40
}
41
+ change_type_order = [
42
+ "BREAKING CHANGE",
43
+ "New features",
44
+ "Bug fixes",
45
+ "Code refactoring",
46
+ "Performance improvements",
47
+ ]
41
48
changelog_pattern = defaults.bump_pattern
42
49
43
50
def questions(self) -> Questions:
Original file line number Diff line number Diff line change 17
17
from commitizen.config import BaseConfig
18
18
from commitizen.cz import registry
19
19
from commitizen.cz.base import BaseCommitizen
20
+ from commitizen.cz.conventional_commits import ConventionalCommitsCz
20
21
from tests.utils import create_file_and_commit
21
22
22
23
SIGNER = "GitHub Action"
@@ -253,3 +254,17 @@ def any_changelog_format(config: BaseConfig) -> ChangelogFormat:
253
254
"""For test not relying on formats specifics, use the default"""
254
255
config.settings["changelog_format"] = defaults.CHANGELOG_FORMAT
255
256
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
+ )
You can’t perform that action at this time.
0 commit comments