@@ -123,9 +123,9 @@ def get_increment(
123
123
124
124
125
125
class ConventionalCommitBumpRule (BumpRule ):
126
+ _BREAKING_CHANGE_TYPES = set (["BREAKING CHANGE" , "BREAKING-CHANGE" ])
127
+ _MINOR_CHANGE_TYPES = set (["feat" ])
126
128
_PATCH_CHANGE_TYPES = set (["fix" , "perf" , "refactor" ])
127
- _BREAKING_CHANGE = r"BREAKING[\-\ ]CHANGE"
128
- _RE_BREAKING_CHANGE = re .compile (_BREAKING_CHANGE )
129
129
130
130
def get_increment (
131
131
self , commit_message : str , major_version_zero : bool
@@ -134,12 +134,12 @@ def get_increment(
134
134
return None
135
135
136
136
change_type = m .group ("change_type" )
137
- if m .group ("bang" ) or self ._RE_BREAKING_CHANGE . match ( change_type ) :
137
+ if m .group ("bang" ) or change_type in self ._BREAKING_CHANGE_TYPES :
138
138
return (
139
139
SemVerIncrement .MINOR if major_version_zero else SemVerIncrement .MAJOR
140
140
)
141
141
142
- if change_type == "feat" :
142
+ if change_type in self . _MINOR_CHANGE_TYPES :
143
143
return SemVerIncrement .MINOR
144
144
145
145
if change_type in self ._PATCH_CHANGE_TYPES :
@@ -150,13 +150,11 @@ def get_increment(
150
150
@cached_property
151
151
def _head_pattern (self ) -> re .Pattern :
152
152
change_types = [
153
- self ._BREAKING_CHANGE ,
154
- "fix" ,
155
- "feat" ,
153
+ * self ._BREAKING_CHANGE_TYPES ,
154
+ * self . _PATCH_CHANGE_TYPES ,
155
+ * self . _MINOR_CHANGE_TYPES ,
156
156
"docs" ,
157
157
"style" ,
158
- "refactor" ,
159
- "perf" ,
160
158
"test" ,
161
159
"build" ,
162
160
"ci" ,
0 commit comments