Skip to content

Commit fbee607

Browse files
refactor: Inline condition and rely on comments to explain the logic
Signed-off-by: Edgar Ramírez Mondragón <edgarrm358@gmail.com>
1 parent 397abe7 commit fbee607

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

commitizen/commands/changelog.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -230,16 +230,14 @@ def __call__(self) -> None:
230230
# Determine if there are prereleases to merge:
231231
# - Only prereleases in changelog (no full release found), OR
232232
# - First version in changelog is before first full release (prereleases exist)
233-
has_prereleases_to_merge = latest_full_release_info.index is not None and (
233+
if latest_full_release_info.index is not None and (
234234
latest_full_release_info.name is None
235235
or (
236236
changelog_meta.latest_version_position is not None
237237
and changelog_meta.latest_version_position
238238
< latest_full_release_info.index
239239
)
240-
)
241-
242-
if has_prereleases_to_merge and latest_full_release_info.index is not None:
240+
):
243241
# Use the existing unreleased_start if available (from get_metadata()).
244242
# Otherwise, use the position of the first version entry (prerelease)
245243
# to preserve the changelog header.

0 commit comments

Comments
 (0)