Skip to content
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

Fix handling of empty indented MiniYAML comments. #21239

Merged
merged 1 commit into from Dec 15, 2023

Conversation

RoosterDragon
Copy link
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
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
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
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
3 checks passed
@PunkPun
Copy link
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