Fix handling of empty indented MiniYAML comments.#21239
Merged
PunkPun merged 1 commit intoOpenRA:bleedfrom Dec 15, 2023
Merged
Conversation
734d8c2 to
45e2dc4
Compare
An empty MiniYaml comment that was indented was previously not recognized, and instead parsed as a key named '#'. Now, indented comments are recognized as comments, which matches the behaviour for unindented lines.
45e2dc4 to
fe8be64
Compare
PunkPun
reviewed
Dec 6, 2023
Member
PunkPun
left a comment
There was a problem hiding this comment.
I find it rather weird that parsing can add additional colons :
Is there a reason why we do this instead of throwing bad intent?
Member
Author
|
This allows you to write "lists" without having to write the colon out on every line, e.g. https://github.com/OpenRA/OpenRA/blob/bleed/mods/ra/mod.yaml#L45 |
Member
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
An empty MiniYaml comment that was indented was previously not recognized, and instead parsed as a key named '#'. Now, indented comments are recognized as comments, which matches the behaviour for unindented lines.
(Hopefully) fixes #20551
This is a longstanding issue, see 0b8a367 from 4 years ago which fixed parsing of empty comments, but didn't extend the test to cover indented empty comments. D'oh!