Closed bclmary closed 3 years ago
This can be controlled with the option (see fprettify -h
)
-l LINE_LENGTH, --line-length LINE_LENGTH
column after which a line should end, viz. -ffree-
line-length-n for GCC (default: 132)
Unlimited line length can be achieved with ./fprettify.py -l 0
.
I should have pointed out that I already use the line length control option -l
. The request concerns the behavior of this option. For now, when a line is too long and the line length is specified, the indentation is sacrificed to keep the line length. I ask for a way to preserve indentation in such cases (prevalence of indentation over line length)
Prevalence of indentation over line length is equivalent to unlimited line length for how fprettify is working. Imposing line length affects nothing else but indentation. For instance, lines that are too long (irrespective of indentation) are not split by fprettify. Therefore I do think -l 0
is exactly what you need.
Ok, I thought fprettify was cutting at least some lines too long. My bad.
Hy, This is a proposition of enhancement related to line length control. If the following is already available with another option, please just let me know.
There is some cases where a very long line is not easily splittable (by easely, I mean with an easy to read result). In my case, it is long strings used for outputs. The current behavior of fprettify in such case is to sacrifice indentation to preserve the line-length directive. I would like to obtain the reverse : preserve indentation by sacrificing the line-length limitation. I tried the
--strict-indent
option, but it seems it was introduce for other purpose.My proposition is to add line-length prevalence for non splittable lines in the
--strict-indent
option.