@@ -407,6 +407,7 @@ def main(
407
407
output_format : str ,
408
408
file_extensions_to_check : str ,
409
409
excluded_file_paths : str ,
410
+ override : bool ,
410
411
verbose : int ,
411
412
) -> bool :
412
413
"""
@@ -424,6 +425,9 @@ def main(
424
425
Comma separated values of what file extensions to check.
425
426
excluded_file_paths : str
426
427
Comma separated values of what file paths to exclude during the check.
428
+ override:
429
+ Whether individual files mentioned in ``source_paths`` should override
430
+ ``excluded_file_paths``.
427
431
verbose : int
428
432
Verbosity level (currently only distinguishes between zero and nonzero).
429
433
@@ -475,7 +479,8 @@ def is_ignored(path: str):
475
479
476
480
for source_path in source_paths :
477
481
if os .path .isfile (source_path ):
478
- check_file (source_path )
482
+ if override or not is_ignored (source_path ):
483
+ check_file (source_path )
479
484
else :
480
485
for subdir , _ , files in os .walk (source_path ):
481
486
if is_ignored (subdir ):
@@ -534,7 +539,20 @@ def is_ignored(path: str):
534
539
parser .add_argument (
535
540
"--excluded-file-paths" ,
536
541
default = "asv_bench/env" ,
537
- help = "Comma separated file paths to exclude." ,
542
+ help = (
543
+ "Comma separated file paths to exclude. If an individual file is "
544
+ "explicitly passed in `paths`, it overrides this setting, unless the "
545
+ "--no-override flag is used."
546
+ ),
547
+ )
548
+ parser .add_argument (
549
+ "--no-override" ,
550
+ dest = "override" ,
551
+ action = "store_false" ,
552
+ help = (
553
+ "Don't allow individual files explicitly mentioned in `pahts` to override "
554
+ "the excluded file paths (see --excluded-file-paths)."
555
+ ),
538
556
)
539
557
parser .add_argument (
540
558
"-v" ,
@@ -552,6 +570,7 @@ def is_ignored(path: str):
552
570
output_format = args .format ,
553
571
file_extensions_to_check = args .included_file_extensions ,
554
572
excluded_file_paths = args .excluded_file_paths ,
573
+ override = args .override ,
555
574
verbose = args .verbose ,
556
575
)
557
576
)
0 commit comments