-
Notifications
You must be signed in to change notification settings - Fork 280
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
exact number of empty lines for document start/end #340
Comments
Hello Christian, Thanks for your crystal-clear message.
Your proposal with Maybe we could define options like this (inspired by rules document-start:
present: true
min-empty-lines-after: 1
max-empty-lines-after: 2 |
@adrienverge Thanks for the explanation! Your thoughts about |
@adrienverge I need your advice again :-) At the moment, there are three types of rules, i.e. It seems that line counting can't be done with the token-based parser, because it only goes up to To support the new
While still getting to know the code-base, I'm not sure about the implications and practicability of these variants. How do you want to proceed? |
Hello @wookietreiber, indeed that's an interesting point.
|
@adrienverge So, if I understand this correctly, |
I would like to enforce having exactly one empty line after document start and exactly one empty line before document end, i.e.:
good
bad
options
I have already forked and wanted to start hacking away, but then I realized from reading through the documentation again and looking at the code and tests, that there are actually two places where this feature could be added:
directly with
document-start
anddocument-end
I imagined something the likes of a new option
empty-line
, allowing either abool
or the stringwhatever
, defaulting towhatever
(compatibility). The behavior would have been:present: true
true
enforce a single empty line after document start / before document end, respectivelyfalse
the empty line is forbiddenwhatever
, don't careIt would also be possible to turn these into an
int
to enforce an exact number of empty lines.with
empty-lines
which already containsmax-start
andmax-end
The feature could also be implemented with
empty-lines
and two new options calledmin-start
andmin-end
.guidance
Before implementing any of these, I would like to ask your guidance about how to implement this. In my opinion, adding this to
document-start
anddocument-end
would be the most intuitive, but this could potentially conflict withmax-start
andmax-end
, while the conflict could also be delegated to the user. Please advise.The text was updated successfully, but these errors were encountered: