Skip to content

Conversation

@climbfuji
Copy link
Collaborator

@climbfuji climbfuji commented Dec 8, 2025

Initial configuration of Codee Fortran formatter with examples (src/*.F90).

This PR adds an initial .codee-format configuration file for the free Codee Fortran formatter and a temporary script run_codee_tmp.sh to get started with the tool (note that the day-to-day usage will be much simpler than in the script). The PR also demonstrates the effect of the formatting rules for the four Fortran source files in src/.

The goal of this PR is to provide the necessary information to decide on the formatting rules we want to use. Once we have agreed on the format, we can update the src/*.F90 files as needed and merge this PR. The integration with GitHub actions and the simplified usage on the command line will come after that. In a 3rd PR, we will work on a tighter integration of the codee format config with the capgen Fortran write to make sure that the auto-generated code also complies with the formatting rules.

The majority of the diffs are because NEPTUNE (and UFS) use two whitespaces as indentation, whereas the files in src/ currently use 3 whitespaces. We can change the codee config, but every space we save makes the lines shorter. To see the remaining differences, please select "Hide whitespaces" when looking at the files changed.

User interface changes?: No

Working toward #703

Testing: No changes to the tests - GitHub actions CI tests passed
test removed:
unit tests:
system tests:
manual testing:

@climbfuji climbfuji self-assigned this Dec 8, 2025
@climbfuji climbfuji marked this pull request as ready for review December 8, 2025 20:23
Copy link
Member

@dustinswales dustinswales left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@climbfuji Thanks for incorporating the code formatter here!
I love the idea, we just need to decide on a few details and incorporate this into our workflows.
As a github action, running the formatter could be invoked either diagnostically (report format violations) or prognostically (fix format violations).

@climbfuji climbfuji requested review from a team as code owners January 5, 2026 15:10
@climbfuji climbfuji changed the title For discussion: initial configuration of Codee Fortran formatter with examples (src/*.F90) Initial configuration of Codee Fortran formatter with examples (src/*.F90) Jan 5, 2026
@mkavulich
Copy link
Collaborator

@climbfuji This PR has merge conflicts that need to be resolved, then it can be merged

@climbfuji
Copy link
Collaborator Author

@climbfuji This PR has merge conflicts that need to be resolved, then it can be merged

On it!

@dustinswales dustinswales self-requested a review January 22, 2026 17:05
Copy link
Collaborator

@mkavulich mkavulich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@mkavulich mkavulich merged commit 6999e2e into NCAR:develop Jan 22, 2026
14 checks passed
@climbfuji climbfuji deleted the feature/codee_format_initial branch January 22, 2026 18:14
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.

5 participants