3535from attributecode import model
3636from attributecode import severities
3737from attributecode .util import extract_zip
38- from attributecode .util import ignore_about_resource_path_error
38+ from attributecode .util import ignore_about_resource_path_not_exist_error
3939from attributecode .util import to_posix
4040
4141
@@ -123,16 +123,12 @@ def cli():
123123 'for any level.'
124124)
125125
126- @click .option ('--validate-about-resource' , is_flag = True , default = False ,
127- help = 'Validate the existence of the about resource.'
128- )
129-
130126@click .option ('-q' , '--quiet' , is_flag = True ,
131127 help = 'Do not print error or warning messages.' )
132128
133129@click .help_option ('-h' , '--help' )
134130
135- def inventory (location , output , mapping , quiet , format , show_all , validate_about_resource ):
131+ def inventory (location , output , mapping , quiet , format , show_all ):
136132 """
137133Collect a JSON or CSV inventory of components from .ABOUT files.
138134
@@ -161,13 +157,8 @@ def inventory(location, output, mapping, quiet, format, show_all, validate_about
161157 for err in write_errors :
162158 errors .append (err )
163159
164- finalized_errors = []
160+ finalized_errors = ignore_about_resource_path_not_exist_error ( errors )
165161
166- if not validate_about_resource :
167- finalized_errors = ignore_about_resource_path_error (errors )
168- else :
169- finalized_errors = errors
170-
171162 log_errors (finalized_errors , quiet , show_all , os .path .dirname (output ))
172163 sys .exit (0 )
173164
@@ -212,17 +203,13 @@ def inventory(location, output, mapping, quiet, format, show_all, validate_about
212203 'for any level.'
213204)
214205
215- @click .option ('--validate-about-resource' , is_flag = True , default = False ,
216- help = 'Validate the existence of the about resource.'
217- )
218-
219206@click .option ('-q' , '--quiet' , is_flag = True ,
220207 help = 'Do not print error or warning messages.' )
221208
222209@click .help_option ('-h' , '--help' )
223210
224211def gen (location , output , mapping , license_notice_text_location , fetch_license ,
225- quiet , show_all , validate_about_resource ):
212+ quiet , show_all ):
226213 """
227214Generate .ABOUT files in OUTPUT directory from a JSON or CSV inventory of .ABOUT files at LOCATION.
228215
@@ -244,12 +231,7 @@ def gen(location, output, mapping, license_notice_text_location, fetch_license,
244231
245232 about_count = len (abouts )
246233 error_count = 0
247- finalized_errors = []
248-
249- if not validate_about_resource :
250- finalized_errors = ignore_about_resource_path_error (errors )
251- else :
252- finalized_errors = errors
234+ finalized_errors = ignore_about_resource_path_not_exist_error (errors )
253235
254236 for e in finalized_errors :
255237 # Only count as warning/error if CRITICAL, ERROR and WARNING
@@ -295,17 +277,12 @@ def gen(location, output, mapping, license_notice_text_location, fetch_license,
295277@click .option ('--template' , type = click .Path (exists = True ), nargs = 1 ,
296278 help = 'Path to an optional custom attribution template used for generation.' )
297279
298- @click .option ('--validate-about-resource' , is_flag = True , default = False ,
299- help = 'Validate the existence of the about resource.'
300- )
301-
302280@click .option ('-q' , '--quiet' , is_flag = True ,
303281 help = 'Do not print error or warning messages.' )
304282
305283@click .help_option ('-h' , '--help' )
306284
307- def attrib (location , output , template , mapping , inventory , quiet , show_all ,
308- validate_about_resource ):
285+ def attrib (location , output , template , mapping , inventory , quiet , show_all ):
309286 """
310287Generate an attribution document at OUTPUT using .ABOUT files at LOCATION.
311288
@@ -337,12 +314,7 @@ def attrib(location, output, template, mapping, inventory, quiet, show_all,
337314 for no_match_error in no_match_errors :
338315 inv_errors .append (no_match_error )
339316
340- finalized_errors = []
341-
342- if not validate_about_resource :
343- finalized_errors = ignore_about_resource_path_error (inv_errors )
344- else :
345- finalized_errors = inv_errors
317+ finalized_errors = ignore_about_resource_path_not_exist_error (inv_errors )
346318
347319 log_errors (finalized_errors , quiet , show_all , os .path .dirname (output ))
348320 click .echo ('Finished.' )
0 commit comments