File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed
test/blackbox-tests/test-cases/pkg/ocamlformat Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -90,14 +90,19 @@ module Ocamlformat = struct
9090 (let open Action_builder.O in
9191 (* This ensures that at is installed as a dev tool before
9292 running it. *)
93- let + () = Action_builder. path path in
93+ let + () = Action_builder. path path
94+ (* Declare the dependency on the input file so changes to the input
95+ file trigger ocamlformat to run again on the updated file. *)
96+ and + () = Action_builder. path (Path. build input) in
9497 let args = [ flag_of_kind kind; Path.Build. basename input ] in
9598 Action. chdir (Path. build dir) @@ Action. run (Ok path) args |> Action.Full. make)
9699 in
97100 let open Action_builder.With_targets.O in
98101 (* Depend on [extra_deps] so if the ocamlformat config file
99102 changes then ocamlformat will run again. *)
100- extra_deps dir >>> action
103+ extra_deps dir
104+ >>> action
105+ |> With_targets. map ~f: (Action.Full. add_sandbox Sandbox_config. needs_sandboxing)
101106 ;;
102107
103108 let action_when_ocamlformat_isn't_locked ~input kind =
Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ Update the file:
4444 Promoting _build/ default /. formatted/ foo. ml to foo. ml.
4545 [1 ]
4646
47- After formatting a second time , the recent change to the file was ignored :
47+ The update to the file persists after formatting it a second time :
4848 $ cat foo. ml
49- let () = print_endline " Hello, world "
49+ let () = print_endline " Hello, ocaml! "
5050 (* formatted with fake ocamlformat * )
You can’t perform that action at this time.
0 commit comments