fortran-lang / fprettify

auto-formatter for modern fortran source code
https://pypi.python.org/pypi/fprettify
Other
370 stars 76 forks source link

Option to ignore paths for recursive #81

Closed hr87 closed 3 years ago

hr87 commented 4 years ago

Add an option to ignore folders or files names from the recursive formatting. This is useful to exclude 3rd-party files from being formatted.

pseewald commented 3 years ago

I think this is already implemented, here are the relevant options to select files (fprettify -h):

  -r, --recursive       Recursively auto-format all Fortran files in
                        subdirectories of specified path; recognized filename
                        extensions: .f, .for, .ftn, .f90, .f95, .f03, .fpp,
                        .F, .FOR, .FTN, .F90, .F95, .F03, .FPP (default:
                        False)
  -e EXCLUDE, --exclude EXCLUDE
                        File or directory patterns to be excluded when
                        searching for Fortran files to format (default: [])
  -f FORTRAN, --fortran FORTRAN
                        Overrides default fortran extensions recognized by
                        --recursive. Repeat this option to specify more than
                        one extension. (default: [])

so --exclude is what you're looking for. Let me know if it does not work as expected.