@@ -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
@@ -476,7 +480,8 @@ def is_ignored(path: str):
476
480
477
481
for source_path in source_paths :
478
482
if os .path .isfile (source_path ):
479
- check_file (source_path )
483
+ if override or not is_ignored (source_path ):
484
+ check_file (source_path )
480
485
else :
481
486
for subdir , _ , files in os .walk (source_path ):
482
487
if is_ignored (subdir ):
@@ -535,7 +540,20 @@ def is_ignored(path: str):
535
540
parser .add_argument (
536
541
"--excluded-file-paths" ,
537
542
default = "asv_bench/env" ,
538
- help = "Comma separated file paths to exclude." ,
543
+ help = (
544
+ "Comma separated file paths to exclude. If an individual file is "
545
+ "explicitly passed in `paths`, it overrides this setting, unless the "
546
+ "--no-override flag is used."
547
+ ),
548
+ )
549
+ parser .add_argument (
550
+ "--no-override" ,
551
+ dest = "override" ,
552
+ action = "store_false" ,
553
+ help = (
554
+ "Don't allow individual files explicitly mentioned in `pahts` to override "
555
+ "the excluded file paths (see --excluded-file-paths)."
556
+ ),
539
557
)
540
558
parser .add_argument (
541
559
"-v" ,
@@ -553,6 +571,7 @@ def is_ignored(path: str):
553
571
output_format = args .format ,
554
572
file_extensions_to_check = args .included_file_extensions ,
555
573
excluded_file_paths = args .excluded_file_paths ,
574
+ override = args .override ,
556
575
verbose = args .verbose ,
557
576
)
558
577
)
0 commit comments