diff --git a/commitizen/cz/conventional_commits/conventional_commits.py b/commitizen/cz/conventional_commits/conventional_commits.py index dcfd7bab89..2af149d09d 100644 --- a/commitizen/cz/conventional_commits/conventional_commits.py +++ b/commitizen/cz/conventional_commits/conventional_commits.py @@ -33,11 +33,18 @@ class ConventionalCommitsCz(BaseCommitizen): bump_map_major_version_zero = defaults.bump_map_major_version_zero commit_parser = r"^((?Pfeat|fix|refactor|perf|BREAKING CHANGE)(?:\((?P[^()\r\n]*)\)|\()?(?P!)?|\w+!):\s(?P.*)?" # noqa change_type_map = { - "feat": "Feat", - "fix": "Fix", - "refactor": "Refactor", - "perf": "Perf", + "feat": "New features", + "fix": "Bug fixes", + "refactor": "Code refactoring", + "perf": "Performance improvements", } + change_type_order = [ + "BREAKING CHANGE", + "New features", + "Bug fixes", + "Code refactoring", + "Performance improvements", + ] changelog_pattern = defaults.bump_pattern def questions(self) -> Questions: diff --git a/tests/conftest.py b/tests/conftest.py index cc306ac6d4..26e537a5db 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -17,6 +17,7 @@ from commitizen.config import BaseConfig from commitizen.cz import registry from commitizen.cz.base import BaseCommitizen +from commitizen.cz.conventional_commits import ConventionalCommitsCz from tests.utils import create_file_and_commit SIGNER = "GitHub Action" @@ -253,3 +254,17 @@ def any_changelog_format(config: BaseConfig) -> ChangelogFormat: """For test not relying on formats specifics, use the default""" config.settings["changelog_format"] = defaults.CHANGELOG_FORMAT return get_changelog_format(config) + + +@pytest.fixture(autouse=True) +def default_change_type_map(mocker: MockerFixture) -> None: + mocker.patch.object( + ConventionalCommitsCz, + "change_type_map", + { + "feat": "Feat", + "fix": "Fix", + "refactor": "Refactor", + "perf": "Perf", + }, + )