Skip to content

Fix handling of empty indented MiniYAML comments.#21239

Merged
PunkPun merged 1 commit intoOpenRA:bleedfrom
RoosterDragon:fix-yaml
Dec 15, 2023
Merged

Fix handling of empty indented MiniYAML comments.#21239
PunkPun merged 1 commit intoOpenRA:bleedfrom
RoosterDragon:fix-yaml

Conversation

@RoosterDragon
Copy link
Copy Markdown
Member

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!

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.
Copy link
Copy Markdown
Member

@PunkPun PunkPun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find it rather weird that parsing can add additional colons :

Is there a reason why we do this instead of throwing bad intent?

@RoosterDragon
Copy link
Copy Markdown
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

Copy link
Copy Markdown
Member

@PunkPun PunkPun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@PunkPun PunkPun merged commit f270cb3 into OpenRA:bleed Dec 15, 2023
@PunkPun
Copy link
Copy Markdown
Member

PunkPun commented Dec 15, 2023

Changelog

@RoosterDragon RoosterDragon deleted the fix-yaml branch December 15, 2023 13:49
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

Successfully merging this pull request may close these issues.

Map-mods with MiniYAML #comments pass lint but don't start

2 participants