Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run fprettify on rwfnestimate #56

Merged
merged 3 commits into from
Feb 15, 2022
Merged

Run fprettify on rwfnestimate #56

merged 3 commits into from
Feb 15, 2022

Conversation

mortenpi
Copy link
Member

@mortenpi mortenpi commented Oct 13, 2020

So, instead of manually undoing all the unnecessary whitespace changes in #28, we can avoid these types of issues altogether in the future by relying on automation and have fprettify format the code automatically. This is sort of a test run -- trying out applying the standard fprettify rules on rwnfestimate, before ideally running it on the whole of GRASP.

For #28, if we merge this, we can run fprettify on that branch there and then we should only have non-trivial changes show up in the diff.

There was one small hurdle -- it looks like fprettify will keep whatever initial indentation the first line of code has for the whole file (e.g. if the PROGRAM statement has 6 spaces in front of it, then fprettify will put 6 spaces in front of every line; would need fortran-lang/fprettify#53). To work around that, I used sed -i -E 's/^\s+(SUBROUTINE|PROGRAM|MODULE)/\1/' *.f90 to remove all whitespace from those lines before running fprettify.

sed -i -E 's/^\s+(SUBROUTINE|PROGRAM|MODULE)/\1/' *.f90
@jongrumer
Copy link
Member

Let's discuss this as well when we meet next week!

@jongrumer jongrumer merged commit 2803a4f into master Feb 15, 2022
@jongrumer jongrumer deleted the mp/fprettify branch February 15, 2022 10:24
mortenpi added a commit that referenced this pull request Feb 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants