@@ -29,7 +29,7 @@ def main(ctx):
29
29
30
30
@main .command ()
31
31
@click .option (
32
- "--baseline-generation-config" ,
32
+ "--baseline-generation-config-path " ,
33
33
required = False ,
34
34
default = None ,
35
35
type = str ,
@@ -40,7 +40,7 @@ def main(ctx):
40
40
""" ,
41
41
)
42
42
@click .option (
43
- "--current-generation-config" ,
43
+ "--current-generation-config-path " ,
44
44
required = False ,
45
45
default = None ,
46
46
type = str ,
@@ -62,8 +62,8 @@ def main(ctx):
62
62
""" ,
63
63
)
64
64
def generate (
65
- baseline_generation_config : str ,
66
- current_generation_config : str ,
65
+ baseline_generation_config_path : str ,
66
+ current_generation_config_path : str ,
67
67
repository_path : str ,
68
68
):
69
69
"""
@@ -87,47 +87,50 @@ def generate(
87
87
The commit history, if generated, will be available in
88
88
repository_path/pr_description.txt.
89
89
"""
90
- default_generation_config = f"{ os .getcwd ()} /generation_config.yaml"
90
+ default_generation_config_path = f"{ os .getcwd ()} /generation_config.yaml"
91
91
92
- if baseline_generation_config is None and current_generation_config is None :
93
- if not os .path .isfile (default_generation_config ):
92
+ if (
93
+ baseline_generation_config_path is None
94
+ and current_generation_config_path is None
95
+ ):
96
+ if not os .path .isfile (default_generation_config_path ):
94
97
raise FileNotFoundError (
95
- f"{ default_generation_config } does not exist. "
98
+ f"{ default_generation_config_path } does not exist. "
96
99
"A valid generation config has to be passed in as "
97
100
"current_generation_config or exist in the current working "
98
101
"directory."
99
102
)
100
- current_generation_config = default_generation_config
101
- elif current_generation_config is None :
103
+ current_generation_config_path = default_generation_config_path
104
+ elif current_generation_config_path is None :
102
105
raise FileNotFoundError (
103
106
"current_generation_config is not specified when "
104
107
"baseline_generation_config is specified. "
105
108
"current_generation_config should be the source of truth of "
106
109
"library generation."
107
110
)
108
111
109
- current_generation_config = os .path .abspath (current_generation_config )
112
+ current_generation_config_path = os .path .abspath (current_generation_config_path )
110
113
repository_path = os .path .abspath (repository_path )
111
- if not baseline_generation_config :
114
+ if not baseline_generation_config_path :
112
115
# Execute full generation based on current_generation_config if
113
116
# baseline_generation_config is not specified.
114
117
# Do not generate pull request description.
115
118
generate_from_yaml (
116
- config_path = current_generation_config ,
117
- config = from_yaml (current_generation_config ),
119
+ config_path = current_generation_config_path ,
120
+ config = from_yaml (current_generation_config_path ),
118
121
repository_path = repository_path ,
119
122
)
120
123
return
121
124
122
125
# Compare two generation configs and only generate changed libraries.
123
126
# Generate pull request description.
124
- baseline_generation_config = os .path .abspath (baseline_generation_config )
127
+ baseline_generation_config_path = os .path .abspath (baseline_generation_config_path )
125
128
config_change = compare_config (
126
- baseline_config = from_yaml (baseline_generation_config ),
127
- current_config = from_yaml (current_generation_config ),
129
+ baseline_config = from_yaml (baseline_generation_config_path ),
130
+ current_config = from_yaml (current_generation_config_path ),
128
131
)
129
132
generate_from_yaml (
130
- config_path = current_generation_config ,
133
+ config_path = current_generation_config_path ,
131
134
config = config_change .current_config ,
132
135
repository_path = repository_path ,
133
136
target_library_names = config_change .get_changed_libraries (),
0 commit comments