@@ -45,17 +45,17 @@ def safe_cast_dict(cls, d: Mapping[str, object]) -> dict[str, VersionIncrement]:
45
45
@staticmethod
46
46
def get_highest_by_messages (
47
47
commit_messages : Iterable [str ],
48
- get_increment : Callable [[str ], VersionIncrement | None ],
48
+ extract_increment : Callable [[str ], VersionIncrement | None ],
49
49
) -> VersionIncrement | None :
50
50
"""Find the highest version increment from a list of messages.
51
51
52
52
This function processes a list of messages and determines the highest version
53
53
increment needed based on the commit messages. It splits multi-line commit messages
54
- and evaluates each line using the provided get_increment callable.
54
+ and evaluates each line using the provided extract_increment callable.
55
55
56
56
Args:
57
57
commit_messages: A list of messages to analyze.
58
- get_increment : A callable that takes a commit message string and returns an
58
+ extract_increment : A callable that takes a commit message string and returns an
59
59
VersionIncrement value (MAJOR, MINOR, PATCH) or None if no increment is needed.
60
60
61
61
Returns:
@@ -65,11 +65,11 @@ def get_highest_by_messages(
65
65
Example:
66
66
>>> commit_messages = ["feat: new feature", "fix: bug fix"]
67
67
>>> rule = ConventionalCommitBumpRule()
68
- >>> VersionIncrement.get_highest_by_messages(commit_messages, lambda x: rule.get_increment (x, False))
68
+ >>> VersionIncrement.get_highest_by_messages(commit_messages, lambda x: rule.extract_increment (x, False))
69
69
'MINOR'
70
70
"""
71
71
return VersionIncrement .get_highest (
72
- get_increment (line )
72
+ extract_increment (line )
73
73
for message in commit_messages
74
74
for line in message .split ("\n " )
75
75
)
@@ -92,7 +92,7 @@ class BumpRule(Protocol):
92
92
such as conventional commits or custom rules.
93
93
"""
94
94
95
- def get_increment (
95
+ def extract_increment (
96
96
self , commit_message : str , major_version_zero : bool
97
97
) -> VersionIncrement | None :
98
98
"""Determine the version increment based on a commit message.
@@ -120,7 +120,7 @@ class ConventionalCommitBumpRule(BumpRule):
120
120
_MINOR_CHANGE_TYPES = set (["feat" ])
121
121
_PATCH_CHANGE_TYPES = set (["fix" , "perf" , "refactor" ])
122
122
123
- def get_increment (
123
+ def extract_increment (
124
124
self , commit_message : str , major_version_zero : bool
125
125
) -> VersionIncrement | None :
126
126
if not (m := self ._head_pattern .match (commit_message )):
@@ -223,7 +223,7 @@ def __init__(
223
223
self .bump_map = bump_map
224
224
self .bump_map_major_version_zero = bump_map_major_version_zero
225
225
226
- def get_increment (
226
+ def extract_increment (
227
227
self , commit_message : str , major_version_zero : bool
228
228
) -> VersionIncrement | None :
229
229
if not (m := self .bump_pattern .search (commit_message )):
0 commit comments