fprettify icon indicating copy to clipboard operation
fprettify copied to clipboard

[Feature request] Impose whitespace formatting only on selected "classes"

Open meteokid opened this issue 6 years ago • 1 comments
trafficstars

Right now whitespace formatting can be turned on/off for everything and some options allow to add/remove whitespaces around "operators".
There is no option to leave whitespace "as-is" for selected "operators".

For example:

$cat test.F90
f(asd,   asd  ,asf+1,asf+ 1)

Would give:

$fprettify.py -s  test.F90
f(asd, asd, asf + 1, asf + 1)

$fprettify.py -s --whitespace-plusminus False  test.F90
f(asd, asd, asf+1, asf+1)

$fprettify.py -s  --disable-whitespace  test.F90
f(asd,   asd  ,asf+1,asf+ 1)

It would be nice to selectively choose what "operators" ['plusminus', 'intrinsics', 'logical', 'assignments', 'multdiv', 'relational', 'print', 'comma', 'type'] have their whitespaces modified and by how much (maybe allow different spacing before and after, useful for commas for example).

meteokid avatar Jun 17 '19 18:06 meteokid

See Pull Request https://github.com/pseewald/fprettify/pull/51 for a branch implementing this

meteokid avatar Jun 19 '19 19:06 meteokid