Strange blank space after allocate in allocate(xxx)
fprettify puts a space after allocate, for example
allocate (dmList(2))
same for deallocate. This seems odd and is jarring.
I believe you can control spaces for intrinsics like allocate or write with the option --whitespace-intrinsics, ie. compare the difference in formatting for
fprettify -d --whitespace-intrinsics false <file>
and
fprettify -d --whitespace-intrinsics true <file>
Thanks for the suggestion, it does indeed remove the blank after allocate before the (
But sadly, it also removes the blank after "end" resulting in code like
endtype gridinfo
which IMHO is even more odd and jarring, so my concern is not resolved.
Well, --whitespace-intrinsics is very broad and it could be differentiated into sub options - the only question is how many special cases we should support since there are so many fortran statements followed by a bracket and I believe fprettify formats them all consistently with a space. For instance, if (.true.) has a space after if, and so does allocate.
You are right that if (xxx) and allocate (xxx) have the same pattern, and I (perhaps unfairly) expect different behavior for each of them. It is because I view if (xxx) as being part of Fortran syntax while I view allocate(xxx) as being the equivalent of a function call and not Fortran "syntax". This makes me suggest --whitespace-intrinsic-function-like as a suboption, which would include allocate, deallocate, and probably lots of other ones, but would not include if (xxx) or end xxx name.