Hold a strong belief that explicit is better than implicit, I really dislike that mix format removes the optional square brackets from the final parameter of a function when that function is a keyword list.
Is there any way to modify mix format's configuration/rules so at the very least it will leave those square brackets alone and -- in an ideal world -- add them where they are missing?
Also, where can I find any information about how to configure the formatting rules which the tool enforces?
The short answer is no.
Here's the long answer:
Elixir formatting is extremely opinionated and it's for a pretty good reason. the format mix task was introduced to enforce conformity among all Elixir projects. It means that any project across the ecosystem that is formatted properly will look and read the same as any other project. It reduces code churn and merge conflicts. More importantly, it immediately stops disputes among team members about "the way I prefer to format muh code".
It's pretty ingenious if you think about it. If you were able to configure it in any way we'd end up with something like a JavaScript formatter where it's basically the wild west where anything goes and even the simplest formatter libraries are extremely configurable.
Some things about the formatter were annoying to me at first, too. However, you'll get over it and you'll be much happier using it than not.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With