dftbplus icon indicating copy to clipboard operation
dftbplus copied to clipboard

Improve import manipulation of Fortran files

Open jubich opened this issue 2 years ago • 2 comments

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.

jubich avatar Feb 11 '24 15:02 jubich

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

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

:exclamation: 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           

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Feb 11 '24 15:02 codecov[bot]