@@ -251,10 +251,11 @@ impl PathSet {
251
251
252
252
fn has ( & self , needle : & Path , module : Kind ) -> bool {
253
253
match self {
254
- PathSet :: Set ( set) => set. iter ( ) . any ( |p| Self :: check ( p, needle, module) ) ,
255
- PathSet :: Suite ( suite) => Self :: check ( suite, needle, module) ,
254
+ PathSet :: Set ( set) => set. iter ( ) . any ( |p| p . path == needle && Self :: check ( p, needle, module) ) ,
255
+ PathSet :: Suite ( suite) => suite . path == needle && Self :: check ( suite, needle, module) ,
256
256
}
257
257
}
258
+
258
259
259
260
// internal use only
260
261
fn check ( p : & TaskPath , needle : & Path , module : Kind ) -> bool {
@@ -417,13 +418,31 @@ impl StepDescription {
417
418
}
418
419
419
420
fn is_excluded ( & self , builder : & Builder < ' _ > , pathset : & PathSet ) -> bool {
420
- if builder. config . skip . iter ( ) . any ( |e| pathset. has ( e, builder. kind ) ) {
421
+ // Helper function to determine if a path is explicitly excluded
422
+ let is_path_excluded = |exclude : & PathBuf | {
423
+ let exclude_path: & Path = exclude. as_path ( ) ;
424
+ pathset. has ( exclude_path, builder. kind )
425
+ } ;
426
+
427
+ // Check if the path is excluded by the --exclude flags
428
+ if builder. config . skip . iter ( ) . any ( is_path_excluded) {
421
429
if !matches ! ( builder. config. dry_run, DryRun :: SelfCheck ) {
422
- println ! ( "Skipping {pathset:?} because it is excluded" ) ;
430
+ println ! ( "Skipping {pathset:?} because it is excluded by --exclude flag " ) ;
423
431
}
424
432
return true ;
425
433
}
426
-
434
+
435
+ // Check if the path is excluded by the exclude field in config.toml
436
+ if let Some ( ref excludes) = builder. config . exclude {
437
+ if excludes. iter ( ) . any ( is_path_excluded) {
438
+ if !matches ! ( builder. config. dry_run, DryRun :: SelfCheck ) {
439
+ println ! ( "Skipping {pathset:?} because it is excluded by config.toml" ) ;
440
+ }
441
+ return true ;
442
+ }
443
+ }
444
+
445
+ // Verbose logging if not excluded
427
446
if !builder. config . skip . is_empty ( ) && !matches ! ( builder. config. dry_run, DryRun :: SelfCheck ) {
428
447
builder. verbose ( || {
429
448
println ! (
@@ -432,6 +451,7 @@ impl StepDescription {
432
451
)
433
452
} ) ;
434
453
}
454
+
435
455
false
436
456
}
437
457
0 commit comments