Skip to content

Commit 50405b0

Browse files
Merge branch 'v4-11-0' into feature/custom-validation
2 parents 5f6482b + 1d0f6cb commit 50405b0

File tree

6 files changed

+668
-521
lines changed

6 files changed

+668
-521
lines changed

.github/workflows/pythonpackage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jobs:
66
python-check:
77
strategy:
88
matrix:
9-
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
9+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
1010
platform: [ubuntu-22.04, macos-latest, windows-latest]
1111
runs-on: ${{ matrix.platform }}
1212
steps:

commitizen/bump.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def find_increment(
6262
def update_version_in_files(
6363
current_version: str,
6464
new_version: str,
65-
files: Iterable[str],
65+
version_files: Iterable[str],
6666
*,
6767
check_consistency: bool,
6868
encoding: str,
@@ -77,7 +77,7 @@ def update_version_in_files(
7777
"""
7878
updated_files = []
7979

80-
for path, pattern in _resolve_files_and_regexes(files, current_version):
80+
for path, pattern in _resolve_files_and_regexes(version_files, current_version):
8181
current_version_found = False
8282
bumped_lines = []
8383

commitizen/commands/bump.py

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -302,33 +302,38 @@ def __call__(self) -> None:
302302
"[NO_COMMITS_TO_BUMP]\nThe commits found are not eligible to be bumped"
303303
)
304304

305-
files: list[str] = []
305+
updated_files: list[str] = []
306306
dry_run = self.arguments["dry_run"]
307307
if self.changelog_flag:
308-
args = {
308+
changelog_args = {
309309
"unreleased_version": new_tag_version,
310310
"template": self.template,
311311
"extras": self.extras,
312312
"incremental": True,
313313
"dry_run": dry_run,
314314
}
315315
if self.changelog_to_stdout:
316-
changelog_cmd = Changelog(self.config, {**args, "dry_run": True}) # type: ignore[typeddict-item]
316+
changelog_cmd = Changelog(
317+
self.config,
318+
{**changelog_args, "dry_run": True}, # type: ignore[typeddict-item]
319+
)
317320
try:
318321
changelog_cmd()
319322
except DryRunExit:
320323
pass
321324

322-
args["file_name"] = self.file_name
323-
changelog_cmd = Changelog(self.config, args) # type: ignore[arg-type]
325+
changelog_cmd = Changelog(
326+
self.config,
327+
{**changelog_args, "file_name": self.file_name}, # type: ignore[typeddict-item]
328+
)
324329
changelog_cmd()
325-
files.append(changelog_cmd.file_name)
330+
updated_files.append(changelog_cmd.file_name)
326331

327332
# Do not perform operations over files or git.
328333
if dry_run:
329334
raise DryRunExit()
330335

331-
files.extend(
336+
updated_files.extend(
332337
bump.update_version_in_files(
333338
str(current_version),
334339
str(new_version),
@@ -360,13 +365,13 @@ def __call__(self) -> None:
360365
raise ExpectedExit()
361366

362367
# FIXME: check if any changes have been staged
363-
git.add(*files)
368+
git.add(*updated_files)
364369
c = git.commit(message, args=self._get_commit_args())
365370
if self.retry and c.return_code != 0 and self.changelog_flag:
366371
# Maybe pre-commit reformatted some files? Retry once
367372
logger.debug("1st git.commit error: %s", c.err)
368373
logger.info("1st commit attempt failed; retrying once")
369-
git.add(*files)
374+
git.add(*updated_files)
370375
c = git.commit(message, args=self._get_commit_args())
371376
if c.return_code != 0:
372377
err = c.err.strip() or c.out

commitizen/commands/changelog.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,8 @@ def __call__(self) -> None:
199199
raise NotAllowed("--incremental cannot be combined with a rev_range")
200200

201201
# Don't continue if no `file_name` specified.
202-
assert self.file_name
202+
if not self.file_name:
203+
raise NotAllowed("filename is required.")
203204

204205
tags = self.tag_rules.get_version_tags(git.get_tags(), warn=True)
205206
changelog_meta = changelog.Metadata()

0 commit comments

Comments
 (0)