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

Use fprettify to reformat F90 code #229

Open
AlexanderRichert-NOAA opened this issue Feb 28, 2024 · 3 comments
Open

Use fprettify to reformat F90 code #229

AlexanderRichert-NOAA opened this issue Feb 28, 2024 · 3 comments

Comments

@AlexanderRichert-NOAA
Copy link
Contributor

Once more of the code is converted to F90 format, I want to explore using fprettify to make the code nice and consistently formatted in terms of indentation, capitalization, etc. So far I like
--case 1 1 1 1 --indent 4 --whitespace 1 --disable-indent-mod --enable-replacements for the argument (plus a code tweak to lower-case all variables).

@edwardhartnett
Copy link
Contributor

I am very interested to see how this goes and if it works well.

On a past Java project I worked with a team of 10+ programmers. We had a java-formatting program that was automatically applied by the CI system before any code was merged (and this is common in Java development). It helped a lot. Previous to that, programmers would reformat code in minor ways, but this would cause code review to be harder. (BTW we were not using GitHub, which has an "ignore whitespace" setting in code review to help with this problem.)

Programmers have strong feelings about their formatting and indentation habits. But software engineering studies have shown:

  1. The organization benefits when a standard formatting is used across all projects.
  2. Programmers adjust over a matter of weeks and get used to any consistent formatting.

So the goal is to pick some formatting not too objectionable to anyone, and then apply it to all NCEPLIBS and (I propose) UFS_UTILS code. We then all have to adjust our editors and habits to match that formatting (probably not too many habits to change as we are all already formatting similarly).

@jbathegit @GeorgeGayno-NOAA what do you think?

@jbathegit
Copy link

I don't personally have any "strong feelings" or objections to anything noted in the fprettify project. So it seems OK to me to consider making further use of it.

@AlexanderRichert-NOAA
Copy link
Contributor Author

Please check out the fprettify'd version of NCEPLIBS-ip: #232
I chose some somewhat arbitrary options as far as indentation, whitespace, capitalization, etc., so nothing is set in stone, but I figure this is a good start for discussing what we do and don't want.

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

No branches or pull requests

3 participants