Skip to content

Commit 7500091

Browse files
committed
no-mistakes(review): Restrict docs example to colon-delimited fixes
1 parent 24fffad commit 7500091

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

‎docs/examples/cz_docs_only.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ class DocsOnlyPatchCommitizen(ConventionalCommitsCz):
1717
bump_map: Maps ``docs`` to no increment and ``fix`` to a patch bump.
1818
"""
1919

20-
bump_pattern = r"^(docs|fix)(?:\([^()\r\n]*\))?!?:"
20+
bump_pattern = r"^(docs|fix)(?:\([^()\r\n]*\))?:"
2121
bump_map = {"docs": None, "fix": "PATCH"}

‎tests/commands/test_documented_python_class_examples.py‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,13 +99,17 @@ def test_documented_python_plugin_docs_commit_does_not_bump(
9999

100100
@pytest.mark.parametrize(
101101
"commit_message",
102-
["fixup! rebase cleanup", "fixture: rename helper"],
102+
[
103+
"fix!: drop old API",
104+
"fixup! rebase cleanup",
105+
"fixture: rename helper",
106+
],
103107
)
104108
@pytest.mark.usefixtures("tmp_commitizen_project")
105-
def test_documented_python_plugin_ignores_fix_prefix_false_positives(
109+
def test_documented_python_plugin_ignores_nonmatching_fix_prefixes(
106110
util: UtilFixture, documented_plugin_name: str, commit_message: str
107111
) -> None:
108-
"""Only full Conventional Commit types participate in bumping."""
112+
"""Only plain fix commits with an optional scope participate in bumping."""
109113
util.create_file_and_commit("fix: seed release")
110114
util.run_cli("--name", documented_plugin_name, "bump", "--yes")
111115
util.create_file_and_commit(commit_message)

0 commit comments

Comments
 (0)