Skip to content

Fix YAML block scalar AST massage - #19758

Closed
rushijagani-dev wants to merge 1 commit into
prettier:mainfrom
rushijagani-dev:fix/yaml-block-value-massage
Closed

rushijagani-dev wants to merge 1 commit into
prettier:mainfrom
rushijagani-dev:fix/yaml-block-value-massage

Conversation

@rushijagani-dev

Copy link
Copy Markdown

Description

Fixes #19256.

YAML AST massage was changing blockLiteral and blockFolded node values to hide trailing whitespace and newline differences. This removes that value rewrite so AST comparison sees the parser value directly. The existing folded block strip fixture currently remains AST-unstable because the printer still drops trailing space-only content, so it is recorded in the AST-unstable fixture list instead of being hidden by massage.

Validation:

  • FULL_TEST=1 yarn jest tests/format/yaml/block-literal tests/format/yaml/block-folded --runInBand - passed; 2 suites, 364 tests, 60 snapshots.
  • yarn jest tests/format/yaml/block-literal tests/format/yaml/block-folded --runInBand - passed; 2 suites, 62 tests, 60 snapshots.
  • yarn prettier --check src/language-yaml/massage-ast/index.js tests/config/format-test/failed-format-tests.js - passed.
  • yarn eslint src/language-yaml/massage-ast/index.js tests/config/format-test/failed-format-tests.js - passed.
  • yarn lint:format-test - passed.

Blockers:

  • Full yarn test and yarn lint were not run locally; this change is limited to YAML AST massage and the format-test unstable fixture registry.
  • The local Corepack download path initially failed with UNABLE_TO_GET_ISSUER_CERT_LOCALLY; dependencies were installed with the repo-pinned Yarn release using NODE_TLS_REJECT_UNAUTHORIZED=0 yarn install --immutable, with no lockfile changes.

Checklist

  • I’ve added tests to confirm my change works.
  • (If changing the API or CLI) I’ve documented the changes I’ve made (in the docs/ directory).
  • (If the change is user-facing) I’ve added my changes to changelog_unreleased/*/XXXX.md file following changelog_unreleased/TEMPLATE.md.
  • I’ve read the contributing guidelines.
  • I did not use AI to generate this PR.
  • (If the above is not checked) I have reviewed the AI-generated content before submitting.

@netlify

netlify Bot commented Jul 30, 2026

Copy link
Copy Markdown

✅ Deploy Preview for prettier ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 27e5b5a
🔍 Latest deploy log https://app.netlify.com/projects/prettier/deploys/6a6ba975fbe93a0008a36818
😎 Deploy Preview https://deploy-preview-19758--prettier.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@fisker fisker closed this Jul 30, 2026
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.

Fix YAML blockLiteral and blockFolded value

2 participants