Skip to content

Commit a72772d

Browse files
committed
refactor(init): replace self.config.settings with DEFAULT_SETTINGS
1 parent 3c546bd commit a72772d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

commitizen/commands/init.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ def __call__(self) -> None:
101101
version_provider = self._ask_version_provider() # select
102102
tag = self._ask_tag() # confirm & select
103103
version_scheme = self._ask_version_scheme() # select
104-
version = get_version_scheme(self.config.settings, version_scheme)(tag)
104+
version = get_version_scheme(DEFAULT_SETTINGS, version_scheme)(tag)
105105
tag_format = self._ask_tag_format(tag) # confirm & text
106106
update_changelog_on_bump = self._ask_update_changelog_on_bump() # confirm
107107
major_version_zero = self._ask_major_version_zero(version) # confirm
@@ -120,7 +120,7 @@ def __call__(self) -> None:
120120
with smart_open(
121121
self._PRE_COMMIT_CONFIG_PATH,
122122
"w",
123-
encoding=self.config.settings["encoding"],
123+
encoding=DEFAULT_SETTINGS["encoding"],
124124
) as config_file:
125125
yaml.safe_dump(config_data, stream=config_file)
126126

@@ -292,7 +292,7 @@ def _get_config_data(self) -> dict[str, Any]:
292292
return {"repos": [CZ_HOOK_CONFIG]}
293293

294294
with open(
295-
self._PRE_COMMIT_CONFIG_PATH, encoding=self.config.settings["encoding"]
295+
self._PRE_COMMIT_CONFIG_PATH, encoding=DEFAULT_SETTINGS["encoding"]
296296
) as config_file:
297297
config_data: dict[str, Any] = yaml.safe_load(config_file) or {}
298298

0 commit comments

Comments
 (0)