Skip to content

Commit 784e3b4

Browse files
refactor: make arguments keyword only
1 parent 3596a06 commit 784e3b4

File tree

5 files changed

+12
-3
lines changed

5 files changed

+12
-3
lines changed

commitizen/commands/check.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ def __call__(self):
7676
for commit in commits
7777
if not (
7878
check := self.cz.validate_commit_message(
79-
commit.message,
80-
pattern,
79+
commit_msg=commit.message,
80+
pattern=pattern,
8181
allow_abort=self.allow_abort,
8282
allowed_prefixes=self.allowed_prefixes,
8383
max_msg_length=self.max_msg_length,

commitizen/cz/base.py

+1
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ def schema_pattern(self) -> str | None:
9898

9999
def validate_commit_message(
100100
self,
101+
*,
101102
commit_msg: str,
102103
pattern: str | None,
103104
allow_abort: bool,

docs/customization.md

+1
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,7 @@ from commitizen import git
323323
class CustomValidationCz(BaseCommitizen):
324324
def validate_commit_message(
325325
self,
326+
*,
326327
commit_msg: str,
327328
pattern: str | None,
328329
allow_abort: bool,

tests/conftest.py

+1
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,7 @@ def schema_pattern(self):
249249

250250
def validate_commit_message(
251251
self,
252+
*,
252253
commit_msg: str,
253254
pattern: str | None,
254255
allow_abort: bool,

tests/test_cz_base.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,13 @@ def test_schema(config):
4545

4646
def test_validate_commit_message(config):
4747
cz = DummyCz(config)
48-
assert cz.validate_commit_message("test", None, False, [], 0) == (True, [])
48+
assert cz.validate_commit_message(
49+
commit_msg="test",
50+
pattern=None,
51+
allow_abort=False,
52+
allowed_prefixes=[],
53+
max_msg_length=0,
54+
) == (True, [])
4955

5056

5157
def test_info(config):

0 commit comments

Comments
 (0)