Skip to content

Commit 7bf082d

Browse files
committed
refactor(BaseCommitizen): remove redundant vars
1 parent dd85165 commit 7bf082d

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

commitizen/cz/base.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -115,17 +115,18 @@ def bump_rule(self) -> BumpRule:
115115
return self._bump_rule
116116

117117
# Fallback to custom bump rule if no bump rule is provided
118-
bump_pattern = self.bump_pattern
119-
bump_map = self.bump_map
120-
bump_map_major_version_zero = self.bump_map_major_version_zero
121-
if not bump_pattern or not bump_map or not bump_map_major_version_zero:
118+
if (
119+
not self.bump_pattern
120+
or not self.bump_map
121+
or not self.bump_map_major_version_zero
122+
):
122123
raise NoPatternMapError(
123-
f"'{self.config.settings['name']}' rule does not support bump: {bump_pattern=}, {bump_map=}, {bump_map_major_version_zero=}"
124+
f"'{self.config.settings['name']}' rule does not support bump: {self.bump_pattern=}, {self.bump_map=}, {self.bump_map_major_version_zero=}"
124125
)
125126
return CustomBumpRule(
126-
bump_pattern,
127-
SemVerIncrement.safe_cast_dict(bump_map),
128-
SemVerIncrement.safe_cast_dict(bump_map_major_version_zero),
127+
self.bump_pattern,
128+
SemVerIncrement.safe_cast_dict(self.bump_map),
129+
SemVerIncrement.safe_cast_dict(self.bump_map_major_version_zero),
129130
)
130131

131132
def example(self) -> str:

0 commit comments

Comments
 (0)