@@ -153,6 +153,10 @@ def validate_extensions(ctx, param, value, extensions=tuple(('.csv', '.json',)))
153153 required = True ,
154154 metavar = 'OUTPUT' ,
155155 type = click .Path (exists = False , dir_okay = False , writable = True , resolve_path = True ))
156+ @click .option ('--exclude' ,
157+ multiple = True ,
158+ metavar = 'PATTERN' ,
159+ help = 'Exclude the processing of the specified input pattern (e.g. *tests* or test/).' )
156160@click .option ('-f' , '--format' ,
157161 is_flag = False ,
158162 default = 'csv' ,
@@ -166,7 +170,7 @@ def validate_extensions(ctx, param, value, extensions=tuple(('.csv', '.json',)))
166170 is_flag = True ,
167171 help = 'Show all error and warning messages.' )
168172@click .help_option ('-h' , '--help' )
169- def inventory (location , output , format , quiet , verbose ): # NOQA
173+ def inventory (location , output , exclude , format , quiet , verbose ): # NOQA
170174 """
171175Collect the inventory of .ABOUT files to a CSV/JSON/XLSX file.
172176
@@ -181,7 +185,7 @@ def inventory(location, output, format, quiet, verbose): # NOQA
181185 if location .lower ().endswith ('.zip' ):
182186 # accept zipped ABOUT files as input
183187 location = extract_zip (location )
184- errors , abouts = collect_inventory (location )
188+ errors , abouts = collect_inventory (location , exclude )
185189 write_output (abouts = abouts , location = output , format = format )
186190
187191 errors_count = report_errors (
@@ -675,7 +679,6 @@ def collect_redist_src(location, output, from_inventory, with_structures, zip, q
675679
676680# FIXME: This is really only a dupe of the Inventory command
677681
678-
679682@about .command (cls = AboutCommand ,
680683 short_help = 'Validate that the format of .ABOUT files is correct and report '
681684 'errors and warnings.' )
@@ -684,6 +687,10 @@ def collect_redist_src(location, output, from_inventory, with_structures, zip, q
684687 metavar = 'LOCATION' ,
685688 type = click .Path (
686689 exists = True , file_okay = True , dir_okay = True , readable = True , resolve_path = True ))
690+ @click .option ('--exclude' ,
691+ multiple = True ,
692+ metavar = 'PATTERN' ,
693+ help = 'Exclude the processing of the specified input pattern (e.g. *tests* or test/).' )
687694@click .option ('--license' ,
688695 is_flag = True ,
689696 help = 'Validate the license_expression value in the input.' )
@@ -701,7 +708,7 @@ def collect_redist_src(location, output, from_inventory, with_structures, zip, q
701708 is_flag = True ,
702709 help = 'Show all error and warning messages.' )
703710@click .help_option ('-h' , '--help' )
704- def check (location , license , djc , log , verbose ):
711+ def check (location , exclude , license , djc , log , verbose ):
705712 """
706713Check .ABOUT file(s) at LOCATION for validity and print error messages.
707714
@@ -722,7 +729,8 @@ def check(location, license, djc, log, verbose):
722729 api_url = djc [0 ].strip ("'" ).strip ('"' )
723730 api_key = djc [1 ].strip ("'" ).strip ('"' )
724731 click .echo ('Checking ABOUT files...' )
725- errors , abouts = collect_inventory (location )
732+
733+ errors , abouts = collect_inventory (location , exclude )
726734
727735 # Validate license_expression
728736 if license :
0 commit comments