Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fd27647

Browse files
authored
Merge pull request #134 from Lee-W/fix-check-command
[Fix] add "bump" into valid commit message in conventional commit
2 parents b913b1e + 7eb8afa commit fd27647

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

commitizen/cz/conventional_commits/conventional_commits.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ def schema(self) -> str:
171171

172172
def schema_pattern(self) -> str:
173173
PATTERN = (
174-
r"(build|ci|docs|feat|fix|perf|refactor|style|test|chore|revert)"
174+
r"(build|ci|docs|feat|fix|perf|refactor|style|test|chore|revert|bump)"
175175
r"(\([\w\-]+\))?:\s.*"
176176
)
177177
return PATTERN

tests/commands/test_check_command.py

+10-2
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,19 @@ def test_check_no_conventional_commit(config, mocker, tmpdir):
9393
error_mock.assert_called_once()
9494

9595

96-
def test_check_conventional_commit(config, mocker, tmpdir):
96+
@pytest.mark.parametrize(
97+
"commit_msg",
98+
(
99+
"feat(lang): added polish language",
100+
"feat: add polish language",
101+
"bump: 0.0.1 -> 1.0.0",
102+
),
103+
)
104+
def test_check_conventional_commit(commit_msg, config, mocker, tmpdir):
97105
success_mock = mocker.patch("commitizen.out.success")
98106

99107
tempfile = tmpdir.join("temp_commit_file")
100-
tempfile.write("feat(lang): added polish language")
108+
tempfile.write(commit_msg)
101109

102110
check_cmd = commands.Check(config=config, arguments={"commit_msg_file": tempfile})
103111

0 commit comments

Comments
 (0)