Repository navigation
fix(scanner): accept trailing empty lines with explicit block indentation - #975
Draft
owenshen0907 wants to merge 1 commit into
Draft
owenshen0907 wants to merge 1 commit into
owenshen0907 wants to merge 1 commit into
Conversation
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #975 +/- ##
==========================================
+ Coverage 80.65% 80.71% +0.06%
==========================================
Files 22 22
Lines 6845 6846 +1
==========================================
+ Hits 5521 5526 +5
+ Misses 905 902 -3
+ Partials 419 418 -1 🚀 New features to boost your workflow:
|
3 tasks done
This branch has not been deployed
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 #974.
At EOF, an explicitly indented block scalar such as
key: |2-rejects trailing empty lines as under-indented content. Its final empty line is passed through the content-indentation check even though YAML permits those trailing lines. Validate EOF indentation only when the current line contains content, preserving the check for an under-indented final content character.The regression tests check decoded values for 120 combinations of literal/folded style, clip/strip/keep, both indicator orders, LF/CRLF/CR, trailing blank lines and a final spaces-only line. All 120 fail on the unchanged source and pass with the fix. Another 18 cases keep rejecting under-indented content and indentation tabs, with and without a final newline.
Validation on the original macOS arm64 machine:
go test -p=4 -race ./...andgo test -p=4 -race ./testdata -modfile=testdata/go_test.modpass.go vet -p=4 ./...,go build -p=4 ./..., gofmt andgit diff --checkpass.FuzzUnmarshalToMap, bounded to 10 seconds and two workers: 369,622 executions, passed.The change concerns accepting valid scalar content at EOF. The separately open #973 concerns the starting-line position of already parsed block tokens. Two files change; dependencies and CI remain unchanged.
Base:
masteratedee2f91616c6d73112a13e7c0dbde72ce938877. See #974 for the minimal reproducer and YAML 1.2.2 references.AI assistance was used; reproduction, implementation and validation results were reviewed locally.
CI follow-up: run 41022753745, head
43f880dca1989ae9b183318245f129bd464dfc9e, completed with 17 successful jobs, one failure and seven fail-fast cancellations. The macOS/Go 1.21 job used macOS 26.6.2 and Go 1.21.13; dyld aborts the root test binary before tests start withmissing LC_UUID load command. This matches the baseline loader failure previously reproduced on unchanged master for #954; it is not a failed assertion in the new regression. Linux race jobs for Go 1.21-1.24 and the i386 jobs pass. Hosted CI is not fully green, and cancelled jobs remain unverified. No workflow change or rerun was made.