You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Issue: Aesthetically, I like it, but in practice, this creates lot of git diff noise when we change the function name during development. Since Fortran function calls can be long, and span multiple lines, this shifts and changes multiple lines at once.
I would like it to be like this by indenting by 4 spaces ...
Essentially, if a line is continued to the next line, it is indented by the values of ContinuationIndentWidth. We can set it to 2space, 4 spaces, or 8 spaces. It's customized by the user for their preference.
Some line continuation indentation examples clang shows are ...
// Example 1someLongFunction(argument1,
argument2);
// Example 2int i = // VeryVeryVeryVeryVeryLongCommentlongFunction( // Again a long comment
arg);
Do note that when a subroutine or one or more functions are called at once, then the indention rule would apply based on the last line, and context i.e if last line starts at column n, the next line would start at column n+indentationWidth.
call ImportSu2Mesh("onera-m6.su2", nodes, cells, &
numNodes, numCells, numDeadCells, numBoundaryCells, &
FunctionToCalculateRandomThing(a, b, c, d, & ! <<< New function called
e, f, g, h, i , j, k, l) & ! <<< Line is indented right
backToOriginalIndentation, endOfSubroutineArguments) ! <<< Line is indented left
Since a new function is continued to the next line, the next line is further indented to the right, and when the function argument list is over, the line is indented left.
Would it not be possible to develop a feature like this?
Currently fprettify does shift everything to the right, in the feature I'm proposing, the shift would just be constant value of 4 spaces or 8 spaces, or as customized by the user.
Thanks
The text was updated successfully, but these errors were encountered:
Also, since modern Fortran has a limit of 132 characters per line, and has a bad history of having very short and famously cryptic names like gemm, axpy, etc ...
Fortran formatters indenting the code to the right so much, is effectively punishing developers for writing long descriptive names.
I know many users like the default option, but to me, same indentation width being used everywhere seems more consistent, and useful.
I will also try to learn more about your code so I can hopefully develop features I need quickly.
As shown above, if we use an & to break the line before passing the first argument to the subroutine/function, then fprettify indents everything only by a single indentation level.
Hi, I recently started using fprettify and I'm liking it very much.
Feature Request:
Currently, fprettify indents function/subroutine arguments to the opening of the bracket ... like this.
Issue: Aesthetically, I like it, but in practice, this creates lot of git diff noise when we change the function name during development. Since Fortran function calls can be long, and span multiple lines, this shifts and changes multiple lines at once.
I would like it to be like this by indenting by 4 spaces ...
or like this by indenting by 8 spaces ...
The indentation width should be customizable by the user.
clang-format supports this for C/C++ with ...
Essentially, if a line is continued to the next line, it is indented by the values of
ContinuationIndentWidth
. We can set it to 2space, 4 spaces, or 8 spaces. It's customized by the user for their preference.Some line continuation indentation examples clang shows are ...
Do note that when a subroutine or one or more functions are called at once, then the indention rule would apply based on the last line, and context i.e if last line starts at column n, the next line would start at column n+indentationWidth.
Since a new function is continued to the next line, the next line is further indented to the right, and when the function argument list is over, the line is indented left.
Would it not be possible to develop a feature like this?
Currently fprettify does shift everything to the right, in the feature I'm proposing, the shift would just be constant value of 4 spaces or 8 spaces, or as customized by the user.
Thanks
The text was updated successfully, but these errors were encountered: