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

Improve import manipulation of Fortran files #1391

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jubich
Copy link
Member

@jubich jubich commented Feb 11, 2024

This PR adds new scripts for editing/formatting imports in Fortran files (.F90 and .f90).

sort_modules now sorts not only the modules alphabetically, but also the imported functions/methods. This script was also used for sorting the imports in #1382. You might consider switching from .sort() to .sort(key=str.casefold) to get a case-insensitive sort.

check_import_usage checks whether the imported functions/methods (with the exception of assignment() and operator()) are used or not. This is done by finding all "import lines". These are removed and then the remaining file is converted into a set of lowercase words. These are then compared with a set created from the imported functions/methods.

Copy link

codecov bot commented Feb 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 70.65%. Comparing base (2e33dae) to head (7a64810).
Report is 54 commits behind head on main.

❗ Current head 7a64810 differs from pull request most recent head 30a9ea0. Consider uploading reports for the commit 30a9ea0 to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1391   +/-   ##
=======================================
  Coverage   70.65%   70.65%           
=======================================
  Files         231      231           
  Lines       43915    43915           
=======================================
  Hits        31029    31029           
  Misses      12886    12886           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jubich jubich force-pushed the import_manipulation branch 3 times, most recently from a90bfee to 7a64810 Compare March 7, 2024 10:16
Copy link
Member

@aradi aradi left a comment

Choose a reason for hiding this comment

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

Please adapt to line lenght 100. (You can reformat mit black -l 100)

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.

None yet

2 participants