You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@adrienverge would you be open to a PR for this? I was thinking maybe a line_break rule that you can pass the root option, so you need to skip a line between root elements and level to say up until what level you need to jump a line between elements.
Hello Victor, I like the idea and would be open to such a contribution.
Instead of a new rule, maybe it would make sense to reuse the empty-lines rule?
Such a feature needs to be well designed and future-proof, so before developing any code (+ tests), we need a clear proposal of new options to be able to achieve complex configurations like:
# 2 empty lines required at top level# 1 empty line required at levels 2, 3 and 4, for mappings only# 1 empty line required at levels 2, for sequences onlya:
k1: v1 k2:
x: 1 s: 1 t:
no: line breaks: here but: it's OK u: 3 y: 2 z: 3 k3: v2b:
- item - item - items:
- subitem - subitem - subitemc: 3
Ideally, we would also need a way to tell whether an empty line is required before first items in sequences and mappings, e.g. in the first comment's example:
# No empty line before first item:rules:
key-duplicates: … trailing-spaces: …# versus:rules:
key-duplicates: … trailing-spaces: …
Also, should lines with comments be accounted for?
So to make it that this is right:
and this is wrong:
I'd say when the following line has less identation than the previous one to force a blank space. Is this possible?
The text was updated successfully, but these errors were encountered: