@@ -23,9 +23,7 @@ open Dunolint.Config.Std
23
23
module Unix = UnixLabels
24
24
25
25
let % expect_test " lint" =
26
- let t =
27
- Dunolint_engine. create ~config: (Dunolint_engine.Config. create ~running_mode: Dry_run )
28
- in
26
+ let t = Dunolint_engine. create ~running_mode: Dry_run () in
29
27
Out_channel. write_all
30
28
" dune-project"
31
29
~data:
@@ -149,9 +147,7 @@ let%expect_test "format_dune_file" =
149
147
150
148
let % expect_test " create-files" =
151
149
(* The engine may be used to create files where they are not initially present. *)
152
- let t =
153
- Dunolint_engine. create ~config: (Dunolint_engine.Config. create ~running_mode: Force_yes )
154
- in
150
+ let t = Dunolint_engine. create ~running_mode: Force_yes () in
155
151
Dunolint_engine. lint_file t ~path: (Relative_path. v " lib/a/dune" ) ~create_file: (fun () ->
156
152
let library = Dune_linter.Library. create ~name: (Dune.Library.Name. v " my-lib" ) () in
157
153
Sexp. to_string_mach (Dune_linter.Library. write library));
@@ -208,9 +204,7 @@ let%expect_test "create-files" =
208
204
209
205
let % expect_test " lint-absent-files" =
210
206
(* By default, [lint-file] will not create a file if no initializer is supplied. *)
211
- let t =
212
- Dunolint_engine. create ~config: (Dunolint_engine.Config. create ~running_mode: Force_yes )
213
- in
207
+ let t = Dunolint_engine. create ~running_mode: Force_yes () in
214
208
Dunolint_engine. lint_file t ~path: (Relative_path. v " absent/file/dune" );
215
209
[% expect {|| }];
216
210
Err.For_test. protect (fun () -> Dunolint_engine. materialize t);
@@ -237,9 +231,7 @@ let%expect_test "invalid files" =
237
231
(* When encountering invalid files during linting, errors are reported, but
238
232
the execution continues so other valid files are still linted. *)
239
233
Err.For_test. protect (fun () ->
240
- let t =
241
- Dunolint_engine. create ~config: (Dunolint_engine.Config. create ~running_mode: Dry_run )
242
- in
234
+ let t = Dunolint_engine. create ~running_mode: Dry_run () in
243
235
Unix. mkdir " invalid" ~perm: 0o755 ;
244
236
Out_channel. write_all
245
237
" dune-project"
@@ -295,9 +287,7 @@ let%expect_test "invalid files" =
295
287
296
288
let % expect_test " file errors" =
297
289
Unix. mkdir " tempdir" ~perm: 0o755 ;
298
- let t =
299
- Dunolint_engine. create ~config: (Dunolint_engine.Config. create ~running_mode: Force_yes )
300
- in
290
+ let t = Dunolint_engine. create ~running_mode: Force_yes () in
301
291
(* If you are trying to lint a path that is not a regular file, you get an
302
292
error right away rather than during [materialize]. *)
303
293
Err.For_test. protect (fun () ->
@@ -314,9 +304,7 @@ let%expect_test "file errors" =
314
304
;;
315
305
316
306
let % expect_test " file-system errors" =
317
- let t =
318
- Dunolint_engine. create ~config: (Dunolint_engine.Config. create ~running_mode: Force_yes )
319
- in
307
+ let t = Dunolint_engine. create ~running_mode: Force_yes () in
320
308
Dunolint_engine. lint_file t ~path: (Relative_path. v " foo/file" ) ~create_file: (fun () ->
321
309
" Hello File" );
322
310
(* Let's say [foo] gets created as a regular file in the interval. *)
0 commit comments