Feedback for `lfortran fmt` to format Fortran source code

Some of my favorite additional features of the two apps I typically use other
than basic indenting are cleanup of whitespace. See

https://sourceforge.net/projects/findent
https://github.com/pseewald/fprettify

  • It is good to get rid of tab characters and trailing spaces at a minimum.
  • An option to collapse multiple blank lines
  • toggle enddo <==> end do, same for goto, endif, elseif, …
  • removing//adding a space around +, =, ==,
  • ([; changing comma to comma-space and vice-versa
  • setting margins and redoing continued and long lines to fit
  • interface/Plugin for vim and (put your favorite editor here)
  • putting & at end and beginning of a continued line (and others would want the
    sometimes-redundant & removed)
  • output of a colorized HTML version similiar to what is generated with
    github markup “```fortran” syntax, or what indent(1), vim(1) and emacs(1)
    autoformatting, …does.

See https://fortranwiki.org/fortran/show/Tools and add your favorites there.
So far, I do not think this sight has a tool list or it is harder to find.
Some kind of better index is needed here. Far easier to find recent changes
and categories on the Fortran Wiki so far.

1 Like