ormolu icon indicating copy to clipboard operation
ormolu copied to clipboard

Basic support for line lengths

Open sellout opened this issue 3 years ago • 0 comments

Is your feature request related to a problem? Please describe.

We use both Ormolu and a line-length linter at work. Sometimes I end up in situations where running Ormolu makes some lines cross the length boundary. Then on the run after fixing Ormolu, I get long-line failures, which I then fix by adding a few newlines to convince Ormolu to reformat the expressions in multi-line style instead of single-line.

This involves a few manual passes to get everything clean.

Describe the solution you'd like

I was thinking that Ormolu may be able to take an optional "max line length" parameter and use it as a hint to force multi-line formatting if a formatted line is longer than the max. I'm not looking for any kind of guarantee, just something that'll reduce the number of cases I have to touch up manually.

sellout avatar Mar 30 '21 15:03 sellout