Skip to content

Commit 4171178

Browse files
committed
refactor(conventional_commits): use TypedDict for answers
1 parent 59fd3f5 commit 4171178

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

commitizen/cz/conventional_commits/conventional_commits.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import os
22
import re
3+
from typing import TypedDict
34

45
from commitizen import defaults
56
from commitizen.cz.base import BaseCommitizen
@@ -27,6 +28,15 @@ def parse_subject(text):
2728
return required_validator(text, msg="Subject is required.")
2829

2930

31+
class ConventionalCommitsAnswers(TypedDict):
32+
prefix: str
33+
scope: str
34+
subject: str
35+
body: str
36+
footer: str
37+
is_breaking_change: bool
38+
39+
3040
class ConventionalCommitsCz(BaseCommitizen):
3141
bump_pattern = defaults.BUMP_PATTERN
3242
bump_map = defaults.BUMP_MAP
@@ -147,7 +157,7 @@ def questions(self) -> Questions:
147157
},
148158
]
149159

150-
def message(self, answers: dict) -> str:
160+
def message(self, answers: ConventionalCommitsAnswers) -> str: # type: ignore[override]
151161
prefix = answers["prefix"]
152162
scope = answers["scope"]
153163
subject = answers["subject"]

0 commit comments

Comments
 (0)