UltraStar-Deluxe / format

UltraStar Format Specification
https://usdx.eu/format
MIT License
11 stars 2 forks source link

[Spec] Allow Empty Lines #50

Open codello opened 6 months ago

codello commented 6 months ago

Suggestion

Currently the spec does not specify how implementations should handle empty lines. I'd like to suggest an addition to the spec that empty line should be ignored. Furthermore I'd like to suggest that implementations should ignore lines that consist only of whitespace (to be defined by #46).

Use case

There are several use cases:

Extra info/examples/attachments

Currently implementations have different behavior as far as I can tell:

Additionally we could also allow leading whitespace (i.e. whitespace before the # in a header or before the note type in the body of a file). However, this does not seem quite as useful to me.

RumovZ commented 6 months ago

Allowing empty lines seems reasonable as they can be useful for grouping and are dropped easily. On the other hand, I don't see any use case for leading whitespace, and lines containing only whitespace would only occur by (rather unlikely) accident. At the same time, this seems slightly more involved to parse correctly, so I wouldn't bother. Of course, implementations could still choose to be more forgiving and ignore whitepsace lines without causing harm.

codello commented 4 months ago

Given there are no other comments I think we can vote on this now with these options:

  1. Allow empty lines but not whitespace-only lines (implementations may still decide to be more forgiving) 🎉
  2. Allow empty lines and whitespace-only lines in the spec (i.e. a compliant implementation MUST ignore whitespace only lines) ❤️
  3. Do not allow empty lines (implementations may still be more forgiving) 🚀