Skip to content

Commit e551cb1

Browse files
committed
refactor(config): move default settings back to defaults
1 parent 075508a commit e551cb1

2 files changed

Lines changed: 12 additions & 7 deletions

File tree

commitizen/config/base_config.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
from typing import Optional
22

3+
from commitizen.defaults import DEFAULT_SETTINGS
4+
35

46
class BaseConfig:
57
def __init__(self):
6-
self._settings: dict = {
7-
"name": "cz_conventional_commits",
8-
"version": None,
9-
"files": [],
10-
"tag_format": None, # example v$version
11-
"bump_message": None, # bumped v$current_version to $new_version
12-
}
8+
self._settings: dict = DEFAULT_SETTINGS.copy()
139
self._path: Optional[str] = None
1410

1511
@property

commitizen/defaults.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@
22
# TODO: .cz, setup.cfg, .cz.cfg should be removed in 2.0
33
config_files: list = ["pyproject.toml", ".cz.toml", ".cz", "setup.cfg", ".cz.cfg"]
44

5+
6+
DEFAULT_SETTINGS = {
7+
"name": "cz_conventional_commits",
8+
"version": None,
9+
"files": [],
10+
"tag_format": None, # example v$version
11+
"bump_message": None, # bumped v$current_version to $new_version
12+
}
13+
514
MAJOR = "MAJOR"
615
MINOR = "MINOR"
716
PATCH = "PATCH"

0 commit comments

Comments
 (0)