File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 10
10
from commitizen .git import GitCommit , smart_open
11
11
from commitizen .version_schemes import DEFAULT_SCHEME , Version , VersionScheme
12
12
13
+ VERSION_TYPES = [None , PATCH , MINOR , MAJOR ]
14
+
13
15
14
16
def find_increment (
15
17
commits : list [GitCommit ], regex : str , increments_map : dict | OrderedDict
@@ -34,12 +36,11 @@ def find_increment(
34
36
new_increment = increments_map [match_pattern ]
35
37
break
36
38
39
+ if VERSION_TYPES .index (increment ) < VERSION_TYPES .index (new_increment ):
40
+ increment = new_increment
41
+
37
42
if increment == MAJOR :
38
43
break
39
- elif increment == MINOR and new_increment == MAJOR :
40
- increment = new_increment
41
- elif increment == PATCH or increment is None :
42
- increment = new_increment
43
44
44
45
return increment
45
46
You can’t perform that action at this time.
0 commit comments