File tree Expand file tree Collapse file tree 1 file changed +9
-11
lines changed Expand file tree Collapse file tree 1 file changed +9
-11
lines changed Original file line number Diff line number Diff line change @@ -208,23 +208,21 @@ def _ask_tag(self) -> str:
208
208
return latest_tag
209
209
210
210
def _ask_tag_format (self , latest_tag : str ) -> str :
211
- is_correct_format = False
212
211
if latest_tag .startswith ("v" ):
213
- tag_format = r"v$version"
212
+ v_tag_format = r"v$version"
214
213
is_correct_format = questionary .confirm (
215
- f'Is "{ tag_format } " the correct tag format?' , style = self .cz .style
214
+ f'Is "{ v_tag_format } " the correct tag format?' , style = self .cz .style
216
215
).unsafe_ask ()
216
+ if is_correct_format :
217
+ return v_tag_format
217
218
218
219
default_format = DEFAULT_SETTINGS ["tag_format" ]
219
- if not is_correct_format :
220
- tag_format = questionary .text (
221
- f'Please enter the correct version format: (default: "{ default_format } ")' ,
222
- style = self .cz .style ,
223
- ).unsafe_ask ()
220
+ tag_format : str = questionary .text (
221
+ f'Please enter the correct version format: (default: "{ default_format } ")' ,
222
+ style = self .cz .style ,
223
+ ).unsafe_ask ()
224
224
225
- if not tag_format :
226
- tag_format = default_format
227
- return tag_format
225
+ return tag_format or default_format
228
226
229
227
def _ask_version_provider (self ) -> str :
230
228
"""Ask for setting: version_provider"""
You can’t perform that action at this time.
0 commit comments