fortran-lang / fprettify

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

Recursive flag does not work when input is a single file #139

Open justsz opened 1 year ago

justsz commented 1 year ago

fprettify -r $X works if X is a directory but not if X is a file.

nbehrnd commented 1 year ago

How do you define a recursion on a file, compared to a recursion in a folder with sub folders? Say you have a folder example on your desktop, organized with a sub folder as in

~/Desktop$ tree ./example/
./example/
├── a.f90
├── b.f90
└── sub
    └── c.f90

1 directory, 3 files

Then, either a) run

~/Desktop$ fprettify ./example/*.f90

to work only in folder example excluding sub folders and their files like c.f90. Or b) use

~/Desktop$ fprettify -r ./example

which equally considers sub folders of folder example and processes their contents (i.e. including file c.f90)

justsz commented 1 year ago

I would say that "recursion on a file" just returns that one file. That's how, e.g. find example/a.f90 -name "*.f90" behaves.