diff --git a/src/dune_config/dune_config.ml b/src/dune_config/dune_config.ml index fdc12ae1bf1..6d0735a4719 100644 --- a/src/dune_config/dune_config.ml +++ b/src/dune_config/dune_config.ml @@ -458,8 +458,8 @@ let auto_concurrency = in loop commands) -let for_scheduler (t : t) ?watch_exclusions stats ~insignificant_changes - ~signal_watcher = +let for_scheduler (t : t) ?(watch_exclusions = standard_watch_exclusions) stats + ~insignificant_changes ~signal_watcher = let concurrency = match t.concurrency with | Fixed i -> i @@ -476,6 +476,5 @@ let for_scheduler (t : t) ?watch_exclusions stats ~insignificant_changes ; stats ; insignificant_changes ; signal_watcher - ; watch_exclusions = - Option.value watch_exclusions ~default:standard_watch_exclusions + ; watch_exclusions } diff --git a/src/dune_config/dune_config.mli b/src/dune_config/dune_config.mli index cd222776e33..5182ad317db 100644 --- a/src/dune_config/dune_config.mli +++ b/src/dune_config/dune_config.mli @@ -122,6 +122,12 @@ val hash : t -> int val equal : t -> t -> bool +(** [for_scheduler config ?watch_exclusions stats_opt ~insignificant_changes + ~signal_watcher] + creates a configuration for a scheduler from the user-visible Dune [config]. + + [watch_exclusions] defaults to {!standard_watch_exclusions} if not + specified. *) val for_scheduler : t -> ?watch_exclusions:string list diff --git a/test/expect-tests/dune_file_watcher/dune_file_watcher_tests_patterns.ml b/test/expect-tests/dune_file_watcher/dune_file_watcher_tests_patterns.ml index 338a0e1853d..876c46e1c49 100644 --- a/test/expect-tests/dune_file_watcher/dune_file_watcher_tests_patterns.ml +++ b/test/expect-tests/dune_file_watcher/dune_file_watcher_tests_patterns.ml @@ -1,10 +1,9 @@ let printf = Printf.printf let test string = - printf "should_exclude(%s) = %s\n" string + printf "should_exclude(%s) = %b\n" string (Dune_file_watcher.For_tests.should_exclude string - Dune_config.standard_watch_exclusions - |> Bool.to_string) + Dune_config.standard_watch_exclusions) let%expect_test _ = test "file.ml";