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

docs(styleguide) Add formatting and explanations to the Style guide #1895

Merged
merged 9 commits into from
Jun 25, 2024

Conversation

Manangka
Copy link
Contributor

@Manangka Manangka commented Jun 24, 2024

In this PR the styleguide has been extended

  • The rules have grouped in different sections to which can be linked
  • Examples have been added to most of the rules to clarify the intent

Checklist of items for pull request

  • Closed issue #xxxx
  • Referenced issue or pull request #xxxx
  • Added new test or modified an existing test
  • Ran black on new and modified autotests
  • Formatted new and modified Fortran source files with fprettify
  • Added doxygen comments to new and modified procedures
  • Updated meson files, makefiles, and Visual Studio project files for new source files
  • Updated definition files
  • Updated develop.tex with a plain-language description of the bug fix, change, feature; required for changes that may affect users
  • Updated input and output guide
  • Removed checklist items not relevant to this pull request

For additional information see instructions for contributing and instructions for developing.

@Manangka Manangka requested a review from wpbonelli June 24, 2024 13:44
@Manangka
Copy link
Contributor Author

@wpbonelli This is still a work in progress but tagging you here to keep you in the loop

Copy link
Contributor

@wpbonelli wpbonelli left a comment

Choose a reason for hiding this comment

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

@Manangka LGTM so far.

@Manangka Manangka marked this pull request as ready for review June 25, 2024 11:06
@Manangka
Copy link
Contributor Author

@wpbonelli I'm done with the bulk of the work. There are a few rules I had trouble explaining. Those were:

  • Avoid implicit none in procedures except where necessary (e.g. interface bodies).
  • Don't use implicit dummy arguments or local variables.

I also found the Include blank lines between: rules a bit vague

Could you have a look at those rules?

@wpbonelli
Copy link
Contributor

@Manangka I think those two about implicits are probably superfluous and can be removed, they are more or less covered by the main point about using implicit none. By the first I just meant to discourage repeating implicit none in procedures/etc when it's already present in the host module. Interface bodies are an exception to this as the module-level statement does not apply in the interface's scope, if I am understanding this thread correctly.

The blank line rules were an arbitrary compromise we arrived at in the FL meeting. I don't have strong feelings about it, maybe others can weigh in. Fprettify will remove double blank lines, but is otherwise accommodating.

@Manangka
Copy link
Contributor Author

Alright. I removed the superfluous implicit rules.

We might also need to think about the layout. For isntance it could be useful if the rules have a rule number or a rule id to which we can refer.
I'm thinking about something like:

M.1 Use implicit none in all modules
M.2 Make modules private by default. Mark public types and procedures explicitly
...
P.1 Don’t end procedures with a return statement; use return only to return early

@wpbonelli
Copy link
Contributor

I like that idea. Should we merge to get an updated render on RTD for feedback, and keep developing in separate PRs?

@langevin-usgs
Copy link
Contributor

I like that idea. Should we merge to get an updated render on RTD for feedback, and keep developing in separate PRs?

Would be great to get this merged so others can easily see on RTD.

@wpbonelli wpbonelli merged commit 17e200e into MODFLOW-USGS:develop Jun 25, 2024
5 checks passed
@wpbonelli wpbonelli added the documentation Documentation changes label Jun 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Documentation changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants