@@ -105,19 +105,18 @@ def is_initial_tag(
105
105
self , current_tag : git .GitTag | None , is_yes : bool = False
106
106
) -> bool :
107
107
"""Check if reading the whole git tree up to HEAD is needed."""
108
- is_initial = False
109
- if not current_tag :
110
- if is_yes :
111
- is_initial = True
112
- else :
113
- out .info ("No tag matching configuration could not be found." )
114
- out .info (
115
- "Possible causes:\n "
116
- "- version in configuration is not the current version\n "
117
- "- tag_format or legacy_tag_formats is missing, check them using 'git tag --list'\n "
118
- )
119
- is_initial = questionary .confirm ("Is this the first tag created?" ).ask ()
120
- return is_initial
108
+ if current_tag :
109
+ return False
110
+ if is_yes :
111
+ return True
112
+
113
+ out .info ("No tag matching configuration could not be found." )
114
+ out .info (
115
+ "Possible causes:\n "
116
+ "- version in configuration is not the current version\n "
117
+ "- tag_format or legacy_tag_formats is missing, check them using 'git tag --list'\n "
118
+ )
119
+ return bool (questionary .confirm ("Is this the first tag created?" ).ask ())
121
120
122
121
def find_increment (self , commits : list [git .GitCommit ]) -> Increment | None :
123
122
# Update the bump map to ensure major version doesn't increment.
@@ -134,10 +133,7 @@ def find_increment(self, commits: list[git.GitCommit]) -> Increment | None:
134
133
raise NoPatternMapError (
135
134
f"'{ self .config .settings ['name' ]} ' rule does not support bump"
136
135
)
137
- increment = bump .find_increment (
138
- commits , regex = bump_pattern , increments_map = bump_map
139
- )
140
- return increment
136
+ return bump .find_increment (commits , regex = bump_pattern , increments_map = bump_map )
141
137
142
138
def __call__ (self ) -> None : # noqa: C901
143
139
"""Steps executed to bump."""
@@ -148,7 +144,7 @@ def __call__(self) -> None: # noqa: C901
148
144
except TypeError :
149
145
raise NoVersionSpecifiedError ()
150
146
151
- bump_commit_message : str = self .bump_settings ["bump_message" ]
147
+ bump_commit_message : str | None = self .bump_settings ["bump_message" ]
152
148
version_files : list [str ] = self .bump_settings ["version_files" ]
153
149
major_version_zero : bool = self .bump_settings ["major_version_zero" ]
154
150
prerelease_offset : int = self .bump_settings ["prerelease_offset" ]
0 commit comments