Skip to content

Commit c953f61

Browse files
bearomorphismLee-W
authored andcommitted
refactor(Bump): remove use of getattr
1 parent 939ee43 commit c953f61

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

commitizen/commands/bump.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,8 @@ def __call__(self) -> None:
216216

217217
rules = TagRules.from_settings(cast(Settings, self.bump_settings))
218218
current_tag = rules.find_tag_for(git.get_tags(), current_version)
219-
current_tag_version = getattr(
220-
current_tag, "name", rules.normalize_tag(current_version)
219+
current_tag_version = (
220+
current_tag.name if current_tag else rules.normalize_tag(current_version)
221221
)
222222

223223
is_initial = self._is_initial_tag(current_tag, self.arguments["yes"])

0 commit comments

Comments
 (0)