Beluga
Beluga copied to clipboard
Introduce an automatic code style formatter
IMO, Current code style is sufficiently inconsistent to introduce a tool for managing it.
~I found that ocamlformat is not so bad in terms of the number of options, reliability, etc.~
How about introducing it and formatting codes with it?
I tried ocamlformat
and ocp-indent
, and no one work really well...
-
ocamlformat
There are too few options to control code style reasonably. It introduces a lot of conflict between formatted codes and tuareg mode indentation. -
ocp-indent
It does not remove redundant spaces, inconsistent linefeed, etc. Furthermore, it also creates issues related to indentation.
Yes, automatic style checking / fixing seems like a tough issue to tackle, tbh. I'm not sure how to handle it.
An ocamlformat
configuration was added in #266. However, most files in the core library and Harpoon are not formatted, and are instead in an .ocamlformat-ignore
file. Automatic formatting may be enabled later for new modules.