Beluga icon indicating copy to clipboard operation
Beluga copied to clipboard

Introduce an automatic code style formatter

Open Ailrun opened this issue 5 years ago • 2 comments

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?

Ailrun avatar Sep 27 '19 16:09 Ailrun

I tried ocamlformat and ocp-indent, and no one work really well...

  1. ocamlformat There are too few options to control code style reasonably. It introduces a lot of conflict between formatted codes and tuareg mode indentation.
  2. ocp-indent It does not remove redundant spaces, inconsistent linefeed, etc. Furthermore, it also creates issues related to indentation.

Ailrun avatar Sep 30 '19 18:09 Ailrun

Yes, automatic style checking / fixing seems like a tough issue to tackle, tbh. I'm not sure how to handle it.

tsani avatar Sep 30 '19 19:09 tsani

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.

MartyO256 avatar Jun 13 '23 00:06 MartyO256