File tree Expand file tree Collapse file tree 1 file changed +14
-19
lines changed Expand file tree Collapse file tree 1 file changed +14
-19
lines changed Original file line number Diff line number Diff line change @@ -68,16 +68,14 @@ def get_highest_by_messages(
6868 >>> commit_messages = ["feat: new feature", "fix: bug fix"]
6969 >>> rule = ConventionalCommitBumpRule()
7070 >>> VersionIncrement.get_highest_by_messages(commit_messages, lambda x: rule.extract_increment(x, False))
71- ' MINOR'
71+ VersionIncrement. MINOR
7272 """
73- return max (
74- (
75- extract_increment (line )
76- for message in commit_messages
77- for line in message .split ("\n " )
78- ),
79- default = VersionIncrement .NONE ,
73+ increments = (
74+ extract_increment (line )
75+ for message in commit_messages
76+ for line in message .split ("\n " )
8077 )
78+ return max (increments , default = VersionIncrement .NONE )
8179
8280
8381class BumpRule (Protocol ):
@@ -231,17 +229,14 @@ def extract_increment(
231229 )
232230
233231 try :
234- if (
235- ret := max (
236- (
237- increment
238- for name , increment in effective_bump_map .items ()
239- if m .group (name )
240- ),
241- default = VersionIncrement .NONE ,
242- )
243- ) is not VersionIncrement .NONE :
244- return ret
232+ increments = (
233+ increment
234+ for name , increment in effective_bump_map .items ()
235+ if m .group (name )
236+ )
237+ increment = max (increments , default = VersionIncrement .NONE )
238+ if increment != VersionIncrement .NONE :
239+ return increment
245240 except IndexError :
246241 pass
247242
You can’t perform that action at this time.
0 commit comments