Skip to content

Commit 309a3c9

Browse files
committed
refactor(commands/bump): use "version_files" internally
#82
1 parent 8b59da1 commit 309a3c9

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

commitizen/commands/bump.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def __call__(self):
8181
current_tag_version: str = bump.create_tag(
8282
current_version, tag_format=tag_format
8383
)
84-
files: list = self.parameters["files"]
84+
version_files: list = self.parameters["version_files"]
8585
dry_run: bool = self.parameters["dry_run"]
8686

8787
is_yes: bool = self.arguments["yes"]
@@ -124,7 +124,7 @@ def __call__(self):
124124
if dry_run:
125125
raise SystemExit()
126126

127-
bump.update_version_in_files(current_version, new_version.public, files)
127+
bump.update_version_in_files(current_version, new_version.public, version_files)
128128
if is_files_only:
129129
raise SystemExit()
130130

commitizen/defaults.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@
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-
65
DEFAULT_SETTINGS = {
76
"name": "cz_conventional_commits",
87
"version": None,
9-
"files": [],
8+
"version_files": [],
109
"tag_format": None, # example v$version
1110
"bump_message": None, # bumped v$current_version to $new_version
1211
}

tests/test_conf.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
[tool.commitizen]
99
name = "cz_jira"
1010
version = "1.0.0"
11-
files = [
11+
version_files = [
1212
"commitizen/__version__.py",
1313
"pyproject.toml"
1414
]
@@ -26,7 +26,7 @@
2626
[commitizen]
2727
name = cz_jira
2828
version = 1.0.0
29-
files = [
29+
version_files = [
3030
"commitizen/__version__.py",
3131
"pyproject.toml"
3232
]
@@ -41,7 +41,7 @@
4141
"version": "1.0.0",
4242
"tag_format": None,
4343
"bump_message": None,
44-
"files": ["commitizen/__version__.py", "pyproject.toml"],
44+
"version_files": ["commitizen/__version__.py", "pyproject.toml"],
4545
"style": [["pointer", "reverse"], ["question", "underline"]],
4646
}
4747

@@ -50,14 +50,14 @@
5050
"version": "2.0.0",
5151
"tag_format": None,
5252
"bump_message": None,
53-
"files": ["commitizen/__version__.py", "pyproject.toml"],
53+
"version_files": ["commitizen/__version__.py", "pyproject.toml"],
5454
"style": [["pointer", "reverse"], ["question", "underline"]],
5555
}
5656

5757
_read_settings = {
5858
"name": "cz_jira",
5959
"version": "1.0.0",
60-
"files": ["commitizen/__version__.py", "pyproject.toml"],
60+
"version_files": ["commitizen/__version__.py", "pyproject.toml"],
6161
"style": [["pointer", "reverse"], ["question", "underline"]],
6262
}
6363

0 commit comments

Comments
 (0)