|
13 | 13 | from commitizen.defaults import CONFIG_FILES, DEFAULT_SETTINGS |
14 | 14 | from commitizen.exceptions import ( |
15 | 15 | InitFailedError, |
16 | | - MissingCzCustomizeConfigError, |
17 | 16 | NoAnswersError, |
18 | 17 | ) |
19 | 18 | from commitizen.git import get_latest_tag_name, get_tag_names, smart_open |
@@ -169,21 +168,23 @@ def _ask_config_path(self) -> Path: |
169 | 168 | return Path(filename) |
170 | 169 |
|
171 | 170 | def _ask_name(self) -> str: |
172 | | - |
173 | 171 | def construct_choice_with_description(cz_name: str) -> questionary.Choice: |
174 | 172 | try: |
175 | 173 | cz_class = registry.get(cz_name)(self.config) |
176 | 174 | if cz_class: |
177 | 175 | first_example = cz_class.schema().partition("\n")[0] |
178 | | - return questionary.Choice(title=cz_name, value=cz_name, description=f"{first_example}") |
179 | | - except MissingCzCustomizeConfigError: |
| 176 | + return questionary.Choice( |
| 177 | + title=cz_name, value=cz_name, description=f"{first_example}" |
| 178 | + ) |
| 179 | + except Exception: # pylint: disable=broad-except |
180 | 180 | pass |
181 | 181 | return questionary.Choice(title=cz_name, value=cz_name) |
182 | 182 |
|
183 | 183 | name: str = questionary.select( |
184 | 184 | "Please choose a cz (commit rule): (default: cz_conventional_commits)", |
185 | 185 | choices=[ |
186 | | - construct_choice_with_description(cz_name) for cz_name in registry.keys() |
| 186 | + construct_choice_with_description(cz_name) |
| 187 | + for cz_name in registry.keys() |
187 | 188 | ], |
188 | 189 | default="cz_conventional_commits", |
189 | 190 | style=self.cz.style, |
|
0 commit comments