@@ -171,21 +171,18 @@ def get_new_version(pyproject_path: str = "pyproject.toml") -> str:
171
171
sys .exit (1 )
172
172
173
173
174
- def add_icon_and_prepare_commit_message (
175
- commit_type : str , current_version : str , new_version : str
176
- ) -> str :
174
+ def add_icon_and_prepare_commit_message (current_version : str , new_version : str ) -> str :
177
175
"""
178
176
Prepares the new commit message with the icon and version bump.
179
177
180
178
Args:
181
- commit_type (str): The type of the commit (e.g., 'chore', 'fix').
182
179
current_version (str): The current version before bump.
183
180
new_version (str): The new version after bump.
184
181
185
182
Returns:
186
183
str: The new commit message.
187
184
"""
188
- icon = TYPE_MAPPING . get ( commit_type . lower (), "" )
185
+ icon = "🔖"
189
186
new_commit_msg = f"{ icon } Bump version: { current_version } → { new_version } "
190
187
logger .debug (f"New commit message: { new_commit_msg } " )
191
188
return new_commit_msg
@@ -272,7 +269,6 @@ def main() -> None:
272
269
commit_type = type_match .group ("type" )
273
270
logger .debug (f"Detected commit type: { commit_type } " )
274
271
else :
275
- commit_type = "chore" # Default to 'chore' if no type is found
276
272
logger .debug ("No commit type detected. Defaulting to 'chore'." )
277
273
278
274
version_bump_part = determine_version_bump (latest_commit_msg )
@@ -286,9 +282,7 @@ def main() -> None:
286
282
287
283
new_version = get_new_version ()
288
284
289
- updated_commit_msg = add_icon_and_prepare_commit_message (
290
- commit_type , current_version , new_version
291
- )
285
+ updated_commit_msg = add_icon_and_prepare_commit_message (current_version , new_version )
292
286
293
287
# Stage the updated pyproject.toml
294
288
stage_changes ()
@@ -313,6 +307,7 @@ def determine_version_bump(commit_msg: str) -> Optional[str]:
313
307
Returns:
314
308
Optional[str]: The version part to bump ('major', 'minor', 'patch') or None.
315
309
"""
310
+ logger .debug (f"Detected commit message: { commit_msg } " )
316
311
match = VERSION_KEYWORD_REGEX .search (commit_msg )
317
312
if match :
318
313
keyword = match .group ("keyword" ).lower ()
0 commit comments