fortran-lang / fprettify

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

define maximum number of empty lines #164

Open stigh opened 6 months ago

stigh commented 6 months ago

Today fprettify will not allow more than 1 consecutive empty lines. Personally I like to keep 2 empty lines between subroutines and functions for improved readability.

See inspiration from eslint here: https://eslint.style/rules/js/no-multiple-empty-lines. According to eslint documentation:

Some developers prefer to have multiple blank lines removed, while others feel that it helps improve readability. Whitespace is useful for separating logical sections of code, but excess whitespace takes up more of the screen.

I see there is a PR in https://github.com/pseewald/fprettify/pull/106, which seem to have been closed unintentionally. --keep-blank-lines would solve my issue, but I think an even better solution would be to define a maximum value.