Open NightBlues opened 8 months ago
To give some context, ocamlformat never aimed at subsuming ocp-indent, nor be fully compatible. Because a few of ocp-indent settings don't make sense from ocamlformat's pov, I don't remember which ones, but that's the conclusion I made when I implemented the ocp-indent-compat
option back then.
The goal of the ocp-indent-compat
option was to make it easier for ocp-indent to run after ocamlformat, as some patterns were easier than others for ocp-indent to process (e.g. if some symbols are at the end of the line vs at the beginning of the line the indentation might differ). This option was necessary for Jane Street projects as they were applying ocp-indent after ocamlformat.
The doc might need to be updated indeed, maybe this option sets too high expectations.
(Imho we might as well remove the feature once this is not useful for Jane Street anymore)
Describe the bug According to man page, usage of ocp-indent-config:
strict_with sets function-indent-nested and match-indent-nested
, but it doesn't seem happen - neitherocamlformat --ocp-indent-config --print-config
shows changed value, nor behavior changes. This create conflict between ocamlformat and ocp-indent because each of them forces its own indentation.How to Reproduce Steps to reproduce the behavior:
ocamlformat --ocp-indent-config test.ml
:Note: '|' are under '(', not under letter 'm'.
ocamlformat --ocp-indent-config test.ml
- result is the same,match-indent-nested = never
setting is ignored.Additional info
strict_with = always
in .ocp-indent file and run ocp-indent again, changes test.ml to: