Hey, I just installed ocamlformat because I’m studying in class with ocaml and I’m trying to configure the formatter such as the code looks like how I was used to format it.
I have currently two point:
- Is it possible to have 4 spaces of indentation after a for/while statement?
- Is it possible to force a if statement to wrap?
Thanks for your replies (:
It seem like my .ocamlformat file isn’t loaded entirely:
(the file is in the same directory as my my test files, btw when I put the .ocamlformat file in my $XDG_CONFIG_HOME, the file isn’t loaded at all which is really weird)
By default ocamlformat does not read configuration outside the project root. If you want $XDG_CONFIG_HOME/.ocamlformat to be used, make sure that there is no .ocamlformat in the project tree, and pass ocamlformat the --enable-outside-detected-project flag. For debugging, it may also help to explicitly pass the --root flag to specify the root of your project, to separate issues of detecting the expected root versus the configuration not having your expected effect.