File tree Expand file tree Collapse file tree 3 files changed +18
-39
lines changed Expand file tree Collapse file tree 3 files changed +18
-39
lines changed Original file line number Diff line number Diff line change 9
9
- poetry install
10
10
11
11
script :
12
- - poetry run pytest -s --cov-report term-missing --cov=commitizen tests/
12
+ - ./scripts/test
13
13
14
14
after_success :
15
15
- codecov
Original file line number Diff line number Diff line change 63
63
"action" : "store_true" ,
64
64
"help" : "show output to stdout, no commit, no modified files" ,
65
65
},
66
+ {
67
+ "name" : "--yes" ,
68
+ "action" : "store_true" ,
69
+ "help" : "accept automatically questions done" ,
70
+ },
66
71
{
67
72
"name" : "--tag-format" ,
68
73
"help" : (
95
100
}
96
101
97
102
98
- def load_cfg ():
99
- settings = {"name" : defaults .name }
100
- config = RawConfigParser ("" )
101
- home = str (Path .home ())
102
-
103
- config_file = ".cz"
104
- global_cfg = os .path .join (home , config_file )
105
-
106
- # load cfg from current project
107
- configs = ["setup.cfg" , ".cz.cfg" , config_file , global_cfg ]
108
- for cfg in configs :
109
- if not os .path .exists (config_file ) and os .path .exists (cfg ):
110
- config_file = cfg
111
-
112
- config_file_exists = os .path .exists (config_file )
113
- if config_file_exists :
114
- logger .debug ('Reading file "%s"' , config_file )
115
- config .read_file (io .open (config_file , "rt" , encoding = "utf-8" ))
116
- log_config = io .StringIO ()
117
- config .write (log_config )
118
- try :
119
- settings .update (dict (config .items ("commitizen" )))
120
- break
121
- except NoSectionError :
122
- # The file does not have commitizen section
123
- continue
124
-
125
- return settings
126
-
127
-
128
103
def main ():
129
104
conf = config .read_cfg ()
130
105
parser = cli (data )
Original file line number Diff line number Diff line change @@ -51,21 +51,25 @@ def __call__(self):
51
51
files : list = self .parameters ["files" ]
52
52
dry_run : bool = self .parameters ["dry_run" ]
53
53
54
+ is_yes : bool = self .arguments ["yes" ]
54
55
prerelease : str = self .arguments ["prerelease" ]
55
56
increment : Optional [str ] = self .arguments ["increment" ]
56
57
is_initial : bool = False
57
58
58
59
# Check if reading the whole git tree up to HEAD is needed.
59
60
if not git .tag_exist (current_tag_version ):
60
- out .info (f"Tag { current_tag_version } could not be found. " )
61
- out .info (
62
- (
63
- "Possible causes:\n "
64
- "- version in configuration is not the current version\n "
65
- "- tag_format is missing, check them using 'git tag --list'\n "
61
+ if is_yes :
62
+ is_initial = True
63
+ else :
64
+ out .info (f"Tag { current_tag_version } could not be found. " )
65
+ out .info (
66
+ (
67
+ "Possible causes:\n "
68
+ "- version in configuration is not the current version\n "
69
+ "- tag_format is missing, check them using 'git tag --list'\n "
70
+ )
66
71
)
67
- )
68
- is_initial = questionary .confirm ("Is this the first tag created?" ).ask ()
72
+ is_initial = questionary .confirm ("Is this the first tag created?" ).ask ()
69
73
70
74
commits = git .get_commits (current_tag_version , from_beginning = is_initial )
71
75
You can’t perform that action at this time.
0 commit comments