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):
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 :
Original file line number Diff line number Diff line change 1717from commitizen .config import BaseConfig
1818from commitizen .cz import registry
1919from commitizen .cz .base import BaseCommitizen
20+ from commitizen .cz .conventional_commits import ConventionalCommitsCz
2021from tests .utils import create_file_and_commit
2122
2223SIGNER = "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+ )
You can’t perform that action at this time.
0 commit comments