ocamlformat
ocamlformat copied to clipboard
Feature request: field-space, but for labeled arguments in declarations
Is your feature request related to a problem? Please describe.
At the moment, even with field-space = loose
, the following ...
val mk :
values : cmj_value Map_string.t ->
effect : effect ->
npm_package_path : Js_packages_info.t ->
cmj_case : cmj_case ->
t
formats to:
val mk :
values:cmj_value Map_string.t ->
effect:effect ->
npm_package_path:Js_packages_info.t ->
cmj_case:cmj_case ->
t
This is not in-line with the style used across the project I'm trying to patch, and results in a lot of diff noise, unfortunately. I can't seem to find a feature that toggles the spacing around :
colons in --intf
files.
Describe the solution you'd like It'd be nice if either:
-
field-space = lose
automatically applied also to labeled-arguments in interfaces, or - a new option to control this spacing was added
Sorry for the late reply. The current direction of ocamlformat is to not add new options, but rather focus on improving the existing preset profiles (default, ocamlformat, janestreet).
I think not having a space around the :
in this case is the most common style in the community but maybe I'm wrong, I'm not opposed to a change like this if the community pushes for it, any thought on this point @samoht @CraigFe @Julow @jberdine ?