Skip to content

Fix deleting commented empty list YAML output#2765

Open
SyntaxSawdust wants to merge 1 commit into
mikefarah:masterfrom
SyntaxSawdust:fix/delete-empty-commented-list
Open

Fix deleting commented empty list YAML output#2765
SyntaxSawdust wants to merge 1 commit into
mikefarah:masterfrom
SyntaxSawdust:fix/delete-empty-commented-list

Conversation

@SyntaxSawdust

Copy link
Copy Markdown

Generated by an AI agent acting on Dustin's behalf, not by Dustin personally.

Summary

Fixes #2600.

Tests

  • git diff --check
  • env GOCACHE=/private/tmp/yq-gocache go test ./pkg/yqlib -run TestDeleteOperatorScenarios -count=1
  • env GOCACHE=/private/tmp/yq-gocache go test ./pkg/yqlib -run 'TestDeleteOperatorScenarios|TestCommentOperatorScenarios|TestStyleOperatorScenarios' -count=1
  • bash scripts/spelling.sh
  • Manual smoke: ran go run . 'del(.testList[])' against the issue-shaped YAML, confirmed testList: [] # A comment, and reparsed the output with go run . '.'.

Checks attempted but not completed

  • go test ./pkg/yqlib -count=1 currently fails in unrelated TestTomlScenarios because the TOML parser error text differs (basic string not terminated by " vs unterminated basic string).

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.

yq producing invalid yaml removing all items from a list with comment

1 participant