File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -165,9 +165,20 @@ def _ask_config_path(self) -> Path:
165165 return Path (filename )
166166
167167 def _ask_name (self ) -> str :
168+
169+ def construct_choice_with_example (cz_name : str ) -> questionary .Choice :
170+ cz_class = registry .get (cz_name )
171+ if cz_class :
172+ first_example = cz_class .example ().splitlines ()[0 ]
173+ title = f"{ cz_name } : { first_example } "
174+ return questionary .Choice (title = title , value = cz_name )
175+ return questionary .Choice (title = cz_name , value = cz_name )
176+
168177 name : str = questionary .select (
169178 "Please choose a cz (commit rule): (default: cz_conventional_commits)" ,
170- choices = list (registry .keys ()),
179+ choices = [
180+ construct_choice_with_example (cz_name ) for cz_name in registry .keys ()
181+ ],
171182 default = "cz_conventional_commits" ,
172183 style = self .cz .style ,
173184 ).unsafe_ask ()
You can’t perform that action at this time.
0 commit comments