fortran-lang / fprettify

auto-formatter for modern fortran source code
https://pypi.python.org/pypi/fprettify
Other
368 stars 73 forks source link

Add automatic breaking lines options #126

Open lsoranco opened 2 years ago

lsoranco commented 2 years ago

I have an old legacy code that is poorly formatted. Most of the lines that should be split are a command "write", and I should be able to define some default procedure to breaking certain lines.

For instance:

WRITE (FILE_ID, *) "my very long line of text"

Should trivially become

WRITE (FILE_ID, *) &
   "my very long line of text"

And things like

WRITE (FILE_ID, *) "you really out did yourself in this line of text", arguments, "it just keeps on going"

Should be broken into

WRITE (FILE_ID, *) &
   "you really out did yourself in this line of text", &
   arguments, "it just keeps on going"

Currently the programm just gives a warning, which helps, but is not a sufficient solution