Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 10 additions & 2 deletions tests/commands/test_check_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -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})

Expand Down