-
-
Notifications
You must be signed in to change notification settings - Fork 38
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
yamlfix squashes spaces in block strings #231
Comments
Hi @wrouesnel thank you for taking the time to open an issue. I can reproduce the issue and agree that it should be fixed. I can't guarantee that it will be fixed soon though :( so if you can, please make a PR :) |
The regex based parsing for fixing comments was breaking block scalars. By using the ruyaml round trip handler, instead the comment formatting now can correctly identify block-scalars and avoid mangling them.
The regex based parsing for fixing comments was breaking block scalars. By using the ruyaml round trip handler, instead the comment formatting now can correctly identify block-scalars and avoid mangling them.
PR opened. The issue was ultimately that regex, line-based parsing incorrectly identified I've implemented a solution based on running the file into the round-trip parser and modifying comment objects directly, which ensures only comments are ever altered. |
The regex based parsing for fixing comments was breaking block scalars. By using the ruyaml round trip handler, instead the comment formatting now can correctly identify block-scalars and avoid mangling them.
The regex based parsing for fixing comments was breaking block scalars. By using the ruyaml round trip handler, instead the comment formatting now can correctly identify block-scalars and avoid mangling them.
The regex based parsing for fixing comments was breaking block scalars. By using the ruyaml round trip handler, instead the comment formatting now can correctly identify block-scalars and avoid mangling them.
The regex based parsing for fixing comments was breaking block scalars. By using the ruyaml round trip handler, instead the comment formatting now can correctly identify block-scalars and avoid mangling them.
Description
When files contain block strings, yamlfix will squash white space and change the string.
Current behavior
Given the file:
yamlfix original.yml
results in:Desired behavior
Strings in block quotes should remain semantically equivalent, or ideally not be modified at all. As it is, white space is removed.
Environment
The text was updated successfully, but these errors were encountered: