fix superfluous comma in flow mappings - #22
Open
Fidelxyz wants to merge 1 commit into
Open
Conversation
|
Hi @Fidelxyz I'm one of the maintainer of yaml/go-yaml a fork maintained by YAML organization & community to replace the discontinued go-yaml/yaml repository that was used to create braydonk/yaml The v3 branch of yaml/go-yaml is a pure fork of go-yaml/yaml. I'm curious if you could confirm if the bug you faced here also affects yaml/go-yaml if so we will create a fix in the main branch (the current v4) cc @ingydotnet |
Author
|
@ccoVeille I conform that the bug also affects yaml/go-yaml. |
|
@Fidelxyz do you think you cool open an issue on https://github.com/yaml/go-yaml then? While I understand there is an issue, I don't get what how to replicate the issue out of yamlfmt Also, I can see @sidsri14 opened He might be interested. |
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.
When a flow mapping ends in non-canonical mode, the emitter no longer writes a trailing comma before the closing
}merely because comments are pending.The comma was a leftover from upstream (117fdf0) and is unnecessary: pending foot comments are emitted after
}, and head/tail comments always start on a new line. This makes flow mappings consistent with flow sequences, which already only emit the trailing comma in canonical mode.Also fixes google/yamlfmt#110 and google/yamlfmt#195.