-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
An option to squash consequtive newlines. #68
Comments
I've found myself wanting it often. Students do this all the time. It's a pity that it's not entirely trivial because of the configurable amount of new lines in a row. But I agree that this configuration is desirable. |
Resolves agda#68 Add an option to check for maximum count of consecutive empty lines. If zero, unlimited cmount is allowed. If 1, there cannot be empty lines, if 2 there can be one empty line, and so on. I fail with naming, having value 1 to disallow any empty lines makes sense, but it's not "maximum amount of empty lines", it's more of "fail if there is that much empty lines".
Resolves agda#68 Add an option to check for maximum count of consecutive empty lines. If zero, unlimited cmount is allowed. If 1, there cannot be empty lines, if 2 there can be one empty line, and so on. I fail with naming, having value 1 to disallow any empty lines makes sense, but it's not "maximum amount of empty lines", it's more of "fail if there is that much empty lines".
I made a PoC. I tried it on GHC codebase, there are 796 files in
So it feels that if this functionality is enabled by default, then 3 (i.e. allowing 2 empty lines) is not too controversial. Allowing only one empty line (with |
When editing files I sometimes end up wth something like
and while this an extreme example, it would be great if
fix-whitespace
had an option to disallow (and fix) more then 2 (or configurable amount) of consequtive newline characters.EDIT: I can write a patch if this feature is ok to have.
The text was updated successfully, but these errors were encountered: