Repository navigation
Preserve final line breaks when trimming whitespace - #330
Open
rksharma-owg wants to merge 1 commit into
Open
rksharma-owg wants to merge 1 commit into
rksharma-owg wants to merge 1 commit into
Conversation
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
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.
Fixes #261.
With
trim_trailing_whitespace=true, the line scanner drops the terminal line break before YAML decoding. A final|or>scalar therefore loses its trailing newline, even witheof_newline=true.Preserve the terminal LF or bare CR when rebuilding the trimmed input. Unterminated scalars keep their existing value. Regression tests compare parsed values across chomping modes and line endings at the trimming boundary, and exercise the reported cases through the formatter with EOF options and repeated formatting.
Validation:
go mod tidy,make vet,make test_v,make integrationtest, andmake addlicense_checkpassed.a8912ab52cb252c270c971bbc7b55147c987b7cbagainstdea0b791be9796b82c2e7cf6864cb7dc36023d0b: baseline and patch checks with upstream automatic toolchain selection, explicit Go 1.23/1.24/1.25 compatibility checks, and license headers. Test caches were cleared between baseline and patch execution.The existing folded-scalar emitter defect tracked in #313/#322 remains separate.
>+is covered at the trimming boundary; the YAML emitter is unchanged.