File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change 55from commitizen .cz .base import BaseCommitizen
66from commitizen .cz .utils import multiple_line_breaker , required_validator
77from commitizen .defaults import Questions
8+ from commitizen .config import BaseConfig
89
910__all__ = ["ConventionalCommitsCz" ]
1011
@@ -40,10 +41,15 @@ class ConventionalCommitsCz(BaseCommitizen):
4041 }
4142 changelog_pattern = defaults .bump_pattern
4243
44+ def __init__ (self , config : BaseConfig ):
45+ super ().__init__ (config )
46+ self .question_type = self .config .settings .get ("question_type" , "list" )
47+
4348 def questions (self ) -> Questions :
49+ # Default questions
4450 questions : Questions = [
4551 {
46- "type" : "list" ,
52+ "type" : self . question_type ,
4753 "name" : "prefix" ,
4854 "message" : "Select the type of change you are committing" ,
4955 "choices" : [
@@ -146,6 +152,9 @@ def questions(self) -> Questions:
146152 ),
147153 },
148154 ]
155+ if questions [0 ]["type" ] == "select" :
156+ questions [0 ].update ({"use_search_filter" : True , "use_jk_keys" : False })
157+
149158 return questions
150159
151160 def message (self , answers : dict ) -> str :
Original file line number Diff line number Diff line change @@ -58,6 +58,7 @@ class Settings(TypedDict, total=False):
5858 always_signoff : bool
5959 template : str | None
6060 extras : dict [str , Any ]
61+ question_type : str | None
6162
6263
6364name : str = "cz_conventional_commits"
You can’t perform that action at this time.
0 commit comments