domluna / JuliaFormatter.jl

An opinionated code formatter for Julia. Plot twist - the opinion is your own.
https://domluna.github.io/JuliaFormatter.jl/dev/
MIT License
568 stars 65 forks source link

Parameter to disable margin constraints? #836

Open MilesCranmer opened 3 months ago

MilesCranmer commented 3 months ago

Is there any way I can disable adherence to the margin entirely, so that lines are simply left unchanged when they go over OR under the margin?

I don't want an infinite margin; what I mean is that I just don't want code to be changed if it is over or under the margin, so I can have complete control of that (I want to use all the other parts of formatting, except for the margin constraint). Some snippets I want to break up into small pieces, and some snippets I would like to leave expanded in a single line.

Basically I would like a parameter for disabling the nest_if_over_margin! function. (As well as its inverse)

domluna commented 3 months ago

the closest thing would be to set margin to a high values 10_000 and then turn on join_lines_based_on_source=true, which is what MinimalStyle does