Skip to content
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

2.0 upgrade removes double empty lines #23

Open
gioccher opened this issue Nov 11, 2024 · 3 comments
Open

2.0 upgrade removes double empty lines #23

gioccher opened this issue Nov 11, 2024 · 3 comments

Comments

@gioccher
Copy link

in 1.1 this was considered valid (and to me desirable):

whatever: true


something: 42

v2.x instead removes duplicated empty lines

whatever: true

something: 42

I like having double empty lines to separate long sections. Is this configurable?

@longkai
Copy link
Owner

longkai commented Nov 12, 2024

Hi, thanks for the issue.

The v1 version implementation is sometimes buggy and may not result same results especially involves comment.

The v2 version focus the consistency of result so multiple successive empty lines would result one.

If you want to separate the long sections I suppose using comments would be better and more reasonable?

@gioccher
Copy link
Author

Thanks for looking into this so quickly!
I didn't realize v1 was supposed to remove double empty lines - it never did for me.
I also didn't think two empty lines would be an considered an issue since that's the default for yamllint
https://github.com/adrienverge/yamllint/blob/master/yamllint/rules/empty_lines.py#L69

Would it be possible to make the max number of empty lines configurable or make it default to 2?

@longkai
Copy link
Owner

longkai commented Nov 30, 2024

Hi, sorry for the delay.

I still think comment is a better way to do separates.

And if you put a comment above, you can place any empty lines as you like. For example:

aa: aa
# this  is a comment



bb:
  cc: ccccc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants