@@ -20,17 +20,11 @@ class Bump:
20
20
def __init__ (self , config : BaseConfig , arguments : dict ):
21
21
self .config : BaseConfig = config
22
22
self .arguments : dict = arguments
23
- self .parameters : dict = {
23
+ self .bump_settings : dict = {
24
24
** config .settings ,
25
25
** {
26
26
key : arguments [key ]
27
- for key in [
28
- "dry_run" ,
29
- "tag_format" ,
30
- "prerelease" ,
31
- "increment" ,
32
- "bump_message" ,
33
- ]
27
+ for key in ["tag_format" , "prerelease" , "increment" , "bump_message" ]
34
28
if arguments [key ] is not None
35
29
},
36
30
}
@@ -65,10 +59,10 @@ def find_increment(self, commits: List[git.GitCommit]) -> Optional[str]:
65
59
)
66
60
return increment
67
61
68
- def __call__ (self ):
62
+ def __call__ (self ): # noqa: C901
69
63
"""Steps executed to bump."""
70
64
try :
71
- current_version_instance : Version = Version (self .parameters ["version" ])
65
+ current_version_instance : Version = Version (self .bump_settings ["version" ])
72
66
except TypeError :
73
67
out .error (
74
68
"[NO_VERSION_SPECIFIED]\n "
@@ -79,19 +73,21 @@ def __call__(self):
79
73
80
74
# Initialize values from sources (conf)
81
75
current_version : str = self .config .settings ["version" ]
82
- tag_format : str = self .parameters ["tag_format" ]
83
- bump_commit_message : str = self .parameters ["bump_message" ]
84
- current_tag_version : str = bump .create_tag (
85
- current_version , tag_format = tag_format
86
- )
87
- version_files : list = self .parameters ["version_files" ]
88
- dry_run : bool = self .parameters ["dry_run" ]
89
76
77
+ tag_format : str = self .bump_settings ["tag_format" ]
78
+ bump_commit_message : str = self .bump_settings ["bump_message" ]
79
+ version_files : list = self .bump_settings ["version_files" ]
80
+
81
+ dry_run : bool = self .arguments ["dry_run" ]
90
82
is_yes : bool = self .arguments ["yes" ]
91
- prerelease : str = self .arguments ["prerelease" ]
92
83
increment : Optional [str ] = self .arguments ["increment" ]
84
+ prerelease : str = self .arguments ["prerelease" ]
93
85
is_files_only : Optional [bool ] = self .arguments ["files_only" ]
94
86
87
+ current_tag_version : str = bump .create_tag (
88
+ current_version , tag_format = tag_format
89
+ )
90
+
95
91
is_initial = self .is_initial_tag (current_tag_version , is_yes )
96
92
if is_initial :
97
93
commits = git .get_commits ()
@@ -121,9 +117,11 @@ def __call__(self):
121
117
)
122
118
123
119
# Report found information
124
- out .write (message )
125
- out .write (f"tag to create: { new_tag_version } " )
126
- out .write (f"increment detected: { increment } " )
120
+ out .write (
121
+ f"message\n "
122
+ f"tag to create: { new_tag_version } \n "
123
+ f"increment detected: { increment } \n "
124
+ )
127
125
128
126
# Do not perform operations over files or git.
129
127
if dry_run :
0 commit comments