diff --git a/ast/dune b/ast/dune index eefc4836b..af9023b1a 100644 --- a/ast/dune +++ b/ast/dune @@ -3,28 +3,31 @@ ;; (per_module ) (library - (name ppxlib_ast) + (name ppxlib_ast) (public_name ppxlib.ast) - (libraries - ocaml-compiler-libs.shadow - ocaml-compiler-libs.common - compiler-libs.common - ocaml-migrate-parsetree - stdlib-shims) - (flags (:standard -open Ocaml_shadow -safe-string) -w -9-27-32) + (libraries ocaml-compiler-libs.shadow ocaml-compiler-libs.common + compiler-libs.common ocaml-migrate-parsetree stdlib-shims) + (flags + (:standard -open Ocaml_shadow -safe-string) + -w + -9-27-32) (preprocess (per_module - ((action (run %{exe:pp/pp.exe} %{ocaml_version} %{input-file})) - versions - location_error))) - (lint (pps ppxlib_traverse -deriving-keep-w32=impl))) + ((action + (run %{exe:pp/pp.exe} %{ocaml_version} %{input-file})) + versions + location_error))) + (lint + (pps ppxlib_traverse -deriving-keep-w32=impl))) ;; This is to make the code compatible with different versions of ;; OCaml + (rule (targets location_helper.ml clflags_helper.ml misc_helper.ml) - (deps gen-compiler_specifics) - (action (run %{ocaml} %{deps} %{ocaml_version} %{targets}))) + (deps gen-compiler_specifics) + (action + (run %{ocaml} %{deps} %{ocaml_version} %{targets}))) (cinaps (files *.ml *.mli) diff --git a/dune b/dune index cc729946e..c5084e76d 100644 --- a/dune +++ b/dune @@ -5,4 +5,5 @@ (alias (name runtest) - (deps (alias_rec lint))) + (deps + (alias_rec lint))) diff --git a/dune-project b/dune-project index 37167f195..6ceeb4c90 100644 --- a/dune-project +++ b/dune-project @@ -2,7 +2,7 @@ (name ppxlib) (using cinaps 1.0) (allow_approximate_merlin) -(formatting disabled) +(formatting (enabled_for dune)) (cram enable) (generate_opam_files true) diff --git a/examples/dune b/examples/dune index 0fb2609b3..0ac85f7bc 100644 --- a/examples/dune +++ b/examples/dune @@ -1,3 +1,4 @@ (alias (name runtest) - (deps (alias_rec all))) + (deps + (alias_rec all))) diff --git a/metaquot/dune b/metaquot/dune index 5a0abab39..a1bea5928 100644 --- a/metaquot/dune +++ b/metaquot/dune @@ -1,9 +1,7 @@ (library - (name ppxlib_metaquot) + (name ppxlib_metaquot) (public_name ppxlib.metaquot) (kind ppx_rewriter) - (flags (:standard -safe-string)) - (libraries - ppxlib - ppxlib_traverse_builtins - ppxlib_metaquot_lifters)) + (flags + (:standard -safe-string)) + (libraries ppxlib ppxlib_traverse_builtins ppxlib_metaquot_lifters)) diff --git a/metaquot_lifters/dune b/metaquot_lifters/dune index 2d35cf6dd..53b194ccb 100644 --- a/metaquot_lifters/dune +++ b/metaquot_lifters/dune @@ -1,5 +1,6 @@ (library - (name ppxlib_metaquot_lifters) + (name ppxlib_metaquot_lifters) (public_name ppxlib.metaquot_lifters) - (flags (:standard -safe-string)) - (libraries ppxlib ppxlib_traverse_builtins)) + (flags + (:standard -safe-string)) + (libraries ppxlib ppxlib_traverse_builtins)) diff --git a/print-diff/dune b/print-diff/dune index 63b5b1783..4967fa27a 100644 --- a/print-diff/dune +++ b/print-diff/dune @@ -1,4 +1,5 @@ (library (name ppxlib_print_diff) (public_name ppxlib.print_diff) - (flags (:standard -safe-string))) + (flags + (:standard -safe-string))) diff --git a/runner/dune b/runner/dune index 0c8bd205d..1e20e493b 100644 --- a/runner/dune +++ b/runner/dune @@ -2,8 +2,9 @@ ;; be linked after all other libraries and units. (library - (name ppxlib_runner) - (public_name ppxlib.runner) - (flags (:standard -safe-string)) - (libraries ppxlib) + (name ppxlib_runner) + (public_name ppxlib.runner) + (flags + (:standard -safe-string)) + (libraries ppxlib) (library_flags -linkall)) diff --git a/runner_as_ppx/dune b/runner_as_ppx/dune index cb199f3c8..c07bcf233 100644 --- a/runner_as_ppx/dune +++ b/runner_as_ppx/dune @@ -1,8 +1,10 @@ ;; This library just contain the entry point for ppx drivers. It must ;; be linked after all other libraries and units. + (library (name ppxlib_runner_as_ppx) (public_name ppxlib.runner_as_ppx) (library_flags -linkall) - (flags (:standard -safe-string)) + (flags + (:standard -safe-string)) (libraries ppxlib)) diff --git a/src/dune b/src/dune index 66b69ee74..ee8917f97 100644 --- a/src/dune +++ b/src/dune @@ -1,20 +1,17 @@ (library (name ppxlib) (public_name ppxlib) - (libraries - ocaml-compiler-libs.common - compiler-libs.common - ocaml-compiler-libs.shadow - ppxlib_ast - ppxlib_print_diff - ppx_derivers - ppxlib_traverse_builtins - stdppx) - (flags (:standard -open Ocaml_shadow -safe-string)) + (libraries ocaml-compiler-libs.common compiler-libs.common + ocaml-compiler-libs.shadow ppxlib_ast ppxlib_print_diff ppx_derivers + ppxlib_traverse_builtins stdppx) + (flags + (:standard -open Ocaml_shadow -safe-string)) (ppx.driver - (main Ppxlib.Driver.standalone) - (flags (-corrected-suffix %{corrected-suffix} -diff-cmd - -dump-ast)) - (lint_flags (-corrected-suffix %{corrected-suffix} -diff-cmd - -null )))) + (main Ppxlib.Driver.standalone) + (flags + (-corrected-suffix %{corrected-suffix} -diff-cmd - -dump-ast)) + (lint_flags + (-corrected-suffix %{corrected-suffix} -diff-cmd - -null)))) (cinaps (files *.ml *.mli) @@ -22,17 +19,21 @@ (rule (targets ast_pattern_generated.ml) - (deps gen/gen_ast_pattern.exe) - (action (run ./gen/gen_ast_pattern.exe %{lib:ppxlib.ast:ast.ml}))) + (deps gen/gen_ast_pattern.exe) + (action + (run ./gen/gen_ast_pattern.exe %{lib:ppxlib.ast:ast.ml}))) (rule (targets ast_builder_generated.ml) (deps gen/gen_ast_builder.exe) - (action (run ./gen/gen_ast_builder.exe %{lib:ppxlib.ast:ast.ml}))) + (action + (run ./gen/gen_ast_builder.exe %{lib:ppxlib.ast:ast.ml}))) ;; This is to make the code compatible with different versions of ;; OCaml + (rule (targets compiler_specifics.ml) - (deps gen-compiler_specifics) - (action (run %{ocaml} %{deps} %{ocaml_version} %{targets}))) + (deps gen-compiler_specifics) + (action + (run %{ocaml} %{deps} %{ocaml_version} %{targets}))) diff --git a/src/gen/dune b/src/gen/dune index ef8098799..2af823cc1 100644 --- a/src/gen/dune +++ b/src/gen/dune @@ -1,9 +1,6 @@ (executables (names gen_ast_pattern gen_ast_builder) - (flags (:standard -safe-string)) - (libraries - ppxlib_ast - compiler-libs.common - compiler-libs.bytecomp - ppxlib_traverse_builtins - stdppx)) + (flags + (:standard -safe-string)) + (libraries ppxlib_ast compiler-libs.common compiler-libs.bytecomp + ppxlib_traverse_builtins stdppx)) diff --git a/stdppx/dune b/stdppx/dune index 9697cde67..da91af662 100644 --- a/stdppx/dune +++ b/stdppx/dune @@ -1,8 +1,6 @@ (library (name stdppx) (public_name ppxlib.stdppx) - (libraries - ocaml-compiler-libs.shadow - sexplib0 - stdlib-shims) - (flags (:standard -open Ocaml_shadow -safe-string))) + (libraries ocaml-compiler-libs.shadow sexplib0 stdlib-shims) + (flags + (:standard -open Ocaml_shadow -safe-string))) diff --git a/test/base/dune b/test/base/dune index 5fd2eaa2c..37beb0365 100644 --- a/test/base/dune +++ b/test/base/dune @@ -1,10 +1,13 @@ (rule (alias runtest) - (enabled_if (>= %{ocaml_version} "4.09.0")) + (enabled_if + (>= %{ocaml_version} "4.09.0")) (deps (:test test.ml) (package ppxlib)) - (action (chdir %{project_root} - (progn - (run expect-test %{test}) - (diff? %{test} %{test}.corrected))))) + (action + (chdir + %{project_root} + (progn + (run expect-test %{test}) + (diff? %{test} %{test}.corrected))))) diff --git a/test/code_path/dune b/test/code_path/dune index 8fd50aaef..40eea9e16 100644 --- a/test/code_path/dune +++ b/test/code_path/dune @@ -1,10 +1,13 @@ (rule (alias runtest) - (enabled_if (>= %{ocaml_version} "4.08.0")) + (enabled_if + (>= %{ocaml_version} "4.08.0")) (deps (:test test.ml) (package ppxlib)) - (action (chdir %{project_root} - (progn - (run expect-test %{test}) - (diff? %{test} %{test}.corrected))))) + (action + (chdir + %{project_root} + (progn + (run expect-test %{test}) + (diff? %{test} %{test}.corrected))))) diff --git a/test/deriving/dune b/test/deriving/dune index 817fb9da7..06179b3fc 100644 --- a/test/deriving/dune +++ b/test/deriving/dune @@ -1,10 +1,13 @@ (rule (alias runtest) - (enabled_if (>= %{ocaml_version} "4.10.0")) + (enabled_if + (>= %{ocaml_version} "4.10.0")) (deps (:test test.ml) (package ppxlib)) - (action (chdir %{project_root} - (progn - (run expect-test %{test}) - (diff? %{test} %{test}.corrected))))) + (action + (chdir + %{project_root} + (progn + (run expect-test %{test}) + (diff? %{test} %{test}.corrected))))) diff --git a/test/deriving/inline/example/dune b/test/deriving/inline/example/dune index 2d600855b..9dba55624 100644 --- a/test/deriving/inline/example/dune +++ b/test/deriving/inline/example/dune @@ -1,9 +1,8 @@ (library - (name ppx_deriving_example) - (preprocess (pps ppx_foo_deriver)) -) + (name ppx_deriving_example) + (preprocess + (pps ppx_foo_deriver))) (alias - (name runtest) - (deps ppx_deriving_example.cma) - ) + (name runtest) + (deps ppx_deriving_example.cma)) diff --git a/test/deriving/inline/foo-deriver/dune b/test/deriving/inline/foo-deriver/dune index 61a791ce0..c6608ced2 100644 --- a/test/deriving/inline/foo-deriver/dune +++ b/test/deriving/inline/foo-deriver/dune @@ -1,5 +1,4 @@ (library - (kind ppx_deriver) - (name ppx_foo_deriver) - (libraries ppxlib) -) + (kind ppx_deriver) + (name ppx_foo_deriver) + (libraries ppxlib)) diff --git a/test/driver/attributes/dune b/test/driver/attributes/dune index 8fd50aaef..40eea9e16 100644 --- a/test/driver/attributes/dune +++ b/test/driver/attributes/dune @@ -1,10 +1,13 @@ (rule (alias runtest) - (enabled_if (>= %{ocaml_version} "4.08.0")) + (enabled_if + (>= %{ocaml_version} "4.08.0")) (deps (:test test.ml) (package ppxlib)) - (action (chdir %{project_root} - (progn - (run expect-test %{test}) - (diff? %{test} %{test}.corrected))))) + (action + (chdir + %{project_root} + (progn + (run expect-test %{test}) + (diff? %{test} %{test}.corrected))))) diff --git a/test/driver/instrument/dune b/test/driver/instrument/dune index f2df06ce2..40eea9e16 100644 --- a/test/driver/instrument/dune +++ b/test/driver/instrument/dune @@ -1,10 +1,13 @@ (rule - (alias runtest) - (enabled_if (>= %{ocaml_version} "4.08.0")) - (deps - (:test test.ml) - (package ppxlib)) - (action (chdir %{project_root} - (progn - (run expect-test %{test}) - (diff? %{test} %{test}.corrected))))) + (alias runtest) + (enabled_if + (>= %{ocaml_version} "4.08.0")) + (deps + (:test test.ml) + (package ppxlib)) + (action + (chdir + %{project_root} + (progn + (run expect-test %{test}) + (diff? %{test} %{test}.corrected))))) diff --git a/test/driver/non-compressible-suffix/dune b/test/driver/non-compressible-suffix/dune index 8fd50aaef..40eea9e16 100644 --- a/test/driver/non-compressible-suffix/dune +++ b/test/driver/non-compressible-suffix/dune @@ -1,10 +1,13 @@ (rule (alias runtest) - (enabled_if (>= %{ocaml_version} "4.08.0")) + (enabled_if + (>= %{ocaml_version} "4.08.0")) (deps (:test test.ml) (package ppxlib)) - (action (chdir %{project_root} - (progn - (run expect-test %{test}) - (diff? %{test} %{test}.corrected))))) + (action + (chdir + %{project_root} + (progn + (run expect-test %{test}) + (diff? %{test} %{test}.corrected))))) diff --git a/test/driver/skip-hash-bang/dune b/test/driver/skip-hash-bang/dune index f37166433..aa7325351 100644 --- a/test/driver/skip-hash-bang/dune +++ b/test/driver/skip-hash-bang/dune @@ -7,5 +7,7 @@ (test (name test) (modules test) - (flags (:standard -safe-string)) - (preprocess (pps empty_rewriter))) + (flags + (:standard -safe-string)) + (preprocess + (pps empty_rewriter))) diff --git a/test/driver/transformations/dune b/test/driver/transformations/dune index ee9da40a9..ef3b8460c 100644 --- a/test/driver/transformations/dune +++ b/test/driver/transformations/dune @@ -7,7 +7,9 @@ (deps (:test test.ml) (package ppxlib)) - (action (chdir %{project_root} - (progn - (run expect-test %{test}) - (diff? %{test} %{test}.corrected))))) + (action + (chdir + %{project_root} + (progn + (run expect-test %{test}) + (diff? %{test} %{test}.corrected))))) diff --git a/test/expect/dune b/test/expect/dune index 2f4c80e47..6733475a3 100644 --- a/test/expect/dune +++ b/test/expect/dune @@ -1,14 +1,20 @@ (executable (name expect_test) - (enabled_if (>= %{ocaml_version} "4.08.0")) + (enabled_if + (>= %{ocaml_version} "4.08.0")) (link_flags (-linkall)) (modes byte) - (libraries unix compiler-libs.toplevel ppxlib ppxlib.metaquot ppxlib.traverse - findlib.top - ;; We don't actually use findlib.dynload, however it is a - ;; special library that causes to record the various - ;; libraries statically linked in with findlib so that - ;; they are not loaded dynamically at runtime - findlib.dynload )) + (libraries + unix + compiler-libs.toplevel + ppxlib + ppxlib.metaquot + ppxlib.traverse + findlib.top + ;; We don't actually use findlib.dynload, however it is a + ;; special library that causes to record the various + ;; libraries statically linked in with findlib so that + ;; they are not loaded dynamically at runtime + findlib.dynload)) (ocamllex expect_lexer) diff --git a/test/quoter/dune b/test/quoter/dune index 8fd50aaef..40eea9e16 100644 --- a/test/quoter/dune +++ b/test/quoter/dune @@ -1,10 +1,13 @@ (rule (alias runtest) - (enabled_if (>= %{ocaml_version} "4.08.0")) + (enabled_if + (>= %{ocaml_version} "4.08.0")) (deps (:test test.ml) (package ppxlib)) - (action (chdir %{project_root} - (progn - (run expect-test %{test}) - (diff? %{test} %{test}.corrected))))) + (action + (chdir + %{project_root} + (progn + (run expect-test %{test}) + (diff? %{test} %{test}.corrected))))) diff --git a/test/traverse/dune b/test/traverse/dune index 8fd50aaef..40eea9e16 100644 --- a/test/traverse/dune +++ b/test/traverse/dune @@ -1,10 +1,13 @@ (rule (alias runtest) - (enabled_if (>= %{ocaml_version} "4.08.0")) + (enabled_if + (>= %{ocaml_version} "4.08.0")) (deps (:test test.ml) (package ppxlib)) - (action (chdir %{project_root} - (progn - (run expect-test %{test}) - (diff? %{test} %{test}.corrected))))) + (action + (chdir + %{project_root} + (progn + (run expect-test %{test}) + (diff? %{test} %{test}.corrected))))) diff --git a/traverse/dune b/traverse/dune index d230de1f9..e5d2b5f68 100644 --- a/traverse/dune +++ b/traverse/dune @@ -1,7 +1,9 @@ (library - (name ppxlib_traverse) + (name ppxlib_traverse) (public_name ppxlib.traverse) (kind ppx_deriver) - (flags (:standard -safe-string)) - (libraries ppxlib) - (preprocess (pps ppxlib_metaquot))) + (flags + (:standard -safe-string)) + (libraries ppxlib) + (preprocess + (pps ppxlib_metaquot))) diff --git a/traverse_builtins/dune b/traverse_builtins/dune index 39d04820e..7e529c114 100644 --- a/traverse_builtins/dune +++ b/traverse_builtins/dune @@ -1,4 +1,5 @@ (library - (name ppxlib_traverse_builtins) + (name ppxlib_traverse_builtins) (public_name ppxlib.traverse_builtins) - (flags (:standard -safe-string))) + (flags + (:standard -safe-string)))