diff --git a/commitizen/cz/conventional_commits/conventional_commits.py b/commitizen/cz/conventional_commits/conventional_commits.py index 14e76393d9..c67b2a5a0d 100644 --- a/commitizen/cz/conventional_commits/conventional_commits.py +++ b/commitizen/cz/conventional_commits/conventional_commits.py @@ -171,7 +171,7 @@ def schema(self) -> str: def schema_pattern(self) -> str: PATTERN = ( - r"(build|ci|docs|feat|fix|perf|refactor|style|test|chore|revert)" + r"(build|ci|docs|feat|fix|perf|refactor|style|test|chore|revert|bump)" r"(\([\w\-]+\))?:\s.*" ) return PATTERN diff --git a/tests/commands/test_check_command.py b/tests/commands/test_check_command.py index c5bed35e61..a53e57b495 100644 --- a/tests/commands/test_check_command.py +++ b/tests/commands/test_check_command.py @@ -93,11 +93,19 @@ def test_check_no_conventional_commit(config, mocker, tmpdir): error_mock.assert_called_once() -def test_check_conventional_commit(config, mocker, tmpdir): +@pytest.mark.parametrize( + "commit_msg", + ( + "feat(lang): added polish language", + "feat: add polish language", + "bump: 0.0.1 -> 1.0.0", + ), +) +def test_check_conventional_commit(commit_msg, config, mocker, tmpdir): success_mock = mocker.patch("commitizen.out.success") tempfile = tmpdir.join("temp_commit_file") - tempfile.write("feat(lang): added polish language") + tempfile.write(commit_msg) check_cmd = commands.Check(config=config, arguments={"commit_msg_file": tempfile})