-
Notifications
You must be signed in to change notification settings - Fork 101
ocamlformat 0.17.0 #634
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ocamlformat 0.17.0 #634
Conversation
Btw. @jonludlam would it please be possible to sync the |
Sounds perfectly reasonable to me. I don't currently use ocp-indent, but I see we've got a customised .ocp-indent file. Given we're using ocamlformat's default configuration, I wonder whether using ocp-indent's defaults work better. If you remove the .ocp-indent file altogether does it work better? |
Well I don't know exactly how |
I gave that a quick try, and the results weren't spectacular - in the sense that while it did reformat a load of files, a subsequent run of ocp-indent was a long way from a no-op. |
the ocamlformat parameter change caused:
whereas the subsequent ocp-indent caused:
|
Well forget about that then. |
But then if I wouldn't mind tweaking my |
Btw. the docs of this flag seems to document the map between |
We already reformatted the whole project with OCamlformat without respecting ocp-indent. The simpler way to make them agree now is to change the ocp-indent config. |
Indeed that's what I suggested :-) |
But I'm still curious about |
OCamlformat formats the whole file. It can't work as an indentation engine because it doesn't try to patch its input but just replaces it. |
I fixed the match clause indentation but for other cases it'll still conflict: #637 (review) |
Ah thanks, I didn't get that.
There are two issues with this:
Altogether from a UX coding point of view I find the current status not to be that great. I don't mind having more rigid structured code editing but I have the feeling that it's not the
Thanks for that ! |
Another issue I have right now is that |
The plan is to extract the parser to its own opam package (still in Odoc's repository). That should be enough. |
Yeah I know, it's not the first time this project runs in circles, we already had that structure a few years ago which was not a great idea either.
Well the problem will remain the same. If you break the parser for |
Btw. one way out would be to make For me it's quite important to be able to change |
This is a known problem but it has been decided (not by me) that constraining which dependencies OCamlformat can have is not the right way of solving this. This sounds a bit like saying "it's not our problem" without proposing a workaround but I believe the outcome will be better if this is solved at the distribution level (eg. OS package managers, a specific mode of Opam). Personally I use Nix to manage ocamlformat and other tools. I'd suggest making an opam switch dedicated to tools that doesn't depend on ocaml's version (ocamlformat, ocp-indent but not merlin) and calling them like this: |
I don't understand, that's not what I suggested. I suggested That solve the problem without having to become utterly bureaucratic about all this and having to babysit multiple opam switches/nix setups or what not just to be able to contribute to |
No description provided.