Skip to content

Commit 107680d

Browse files
committed
refactor: replace hard-coded string "cz_conventional_commits" with DEFAULT_SETTINGS (#1830)
1 parent 5ef1be5 commit 107680d

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

commitizen/cli.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
from decli import cli
1414

1515
from commitizen import commands, config, out, version_schemes
16+
from commitizen.defaults import DEFAULT_SETTINGS
1617
from commitizen.exceptions import (
1718
CommitizenException,
1819
ExitCode,
@@ -672,7 +673,7 @@ def main() -> None:
672673
if args.name:
673674
conf.update({"name": args.name})
674675
elif not conf.path:
675-
conf.update({"name": "cz_conventional_commits"})
676+
conf.update({"name": DEFAULT_SETTINGS["name"]})
676677

677678
if args.debug:
678679
logging.getLogger("commitizen").setLevel(logging.DEBUG)

commitizen/commands/init.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,9 @@ def _ask_config_path(self) -> Path:
170170

171171
def _ask_name(self) -> str:
172172
name: str = questionary.select(
173-
"Please choose a cz (commit rule): (default: cz_conventional_commits)",
173+
f"Please choose a cz (commit rule): (default: {DEFAULT_SETTINGS['name']})",
174174
choices=self._construct_name_choice_with_description(),
175-
default="cz_conventional_commits",
175+
default=DEFAULT_SETTINGS["name"],
176176
style=self.cz.style,
177177
).unsafe_ask()
178178
return name

0 commit comments

Comments
 (0)