CTSM icon indicating copy to clipboard operation
CTSM copied to clipboard

Start using a FORTRAN formatter for our code and remove the vertical alignment

Open ekluzek opened this issue 2 years ago • 1 comments

In #2144 we decided to stop adding vertical alignment in our code. With that we should remove all of the current vertical alignment in the code. But, we want to use a tool to do it for us.

@adrifoster pointed to fprettify which does for FORTRAN code. We aren't sure if that's the right formatter to use, but it's one of the few that can be used for FORTRAN. We could also develop our own, but that might not be worth the effort.

Definition of Done:

  • [ ] Choose or develop a formatter for FORTRAN
  • [ ] Decide if we need this for perl or XML as well?
  • [ ] Run it on all of the FORTRAN code
  • [ ] Make a tag with the update making sure it all works
  • [ ] Add a precommit option to run this for us
  • [ ] Add a github action to check it for PR's

ekluzek avatar Sep 07 '23 22:09 ekluzek

This topic came up in CSEG on 9/19/2023 and these are the notes that we have from that meeting...

Fortran equivalent of black Mike: Is there a Fortran equivalent of black (auto-formatter, something that Github Action can run and flag as failure if code changes)?

Erik: Adrianna found the formatter fprettify (https://github.com/pseewald/fprettify)

There is a VSCode extension Michael: Has played around with various Fortran formatters. Some were okay, some were not great. The biggest issue they had at ORNL was finding one that was maintained / supported.

ekluzek avatar Sep 25 '23 23:09 ekluzek