From abee1196d806d46bb85ae940cffcf9670f323a90 Mon Sep 17 00:00:00 2001 From: Hugo Heuzard Date: Tue, 26 Nov 2024 14:55:08 +0100 Subject: [PATCH] WIP --- lib/Conf.ml | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/lib/Conf.ml b/lib/Conf.ml index 04f6511297..368eef3e8b 100644 --- a/lib/Conf.ml +++ b/lib/Conf.ml @@ -443,8 +443,7 @@ module Formatting = struct in Decl.choice ~names ~all ~default ~doc ~kind (fun conf elt -> - update conf ~f:(fun f -> {f with break_collection_expressions= elt}) - ) + update conf ~f:(fun f -> {f with break_collection_expressions= elt}) ) (fun conf -> conf.fmt_opts.break_collection_expressions) let break_colon = @@ -598,8 +597,7 @@ module Formatting = struct Decl.choice ~names ~all ~default ~doc ~kind (fun conf elt -> update conf ~f:(fun f -> - {f with break_struct= Elt.make Poly.(elt.v = `Force) elt.from} ) - ) + {f with break_struct= Elt.make Poly.(elt.v = `Force) elt.from} ) ) (fun conf -> let elt = conf.fmt_opts.break_struct in if elt.v then Elt.make `Force elt.from @@ -896,8 +894,7 @@ module Formatting = struct in Decl.choice ~names ~all ~default ~doc ~kind (fun conf elt -> - update conf ~f:(fun f -> {f with indicate_nested_or_patterns= elt}) - ) + update conf ~f:(fun f -> {f with indicate_nested_or_patterns= elt}) ) (fun conf -> conf.fmt_opts.indicate_nested_or_patterns) let infix_precedence = @@ -924,8 +921,7 @@ module Formatting = struct let names = ["leading-nested-match-parens"] in Decl.flag ~names ~default ~doc ~kind ~allow_inline:false (fun conf elt -> - update conf ~f:(fun f -> {f with leading_nested_match_parens= elt}) - ) + update conf ~f:(fun f -> {f with leading_nested_match_parens= elt}) ) (fun conf -> conf.fmt_opts.leading_nested_match_parens) let let_and = @@ -1547,8 +1543,8 @@ let parse_attr {attr_name= {txt; loc= _}; attr_payload; _} = | _ when String.is_prefix ~prefix:"ocamlformat." txt -> Error (`Msg - (Format.sprintf "Invalid format: Unknown suffix %S" - (String.chop_prefix_exn ~prefix:"ocamlformat." txt) ) ) + (Format.sprintf "Invalid format: Unknown suffix %S" + (String.chop_prefix_exn ~prefix:"ocamlformat." txt) ) ) | _ -> Error `Ignore let update ?(quiet = false) c ({attr_name= {txt; loc}; _} as attr) =