Skip to content

feat(format/yaml): flow mappings - #11011

Merged
dyc3 merged 2 commits into
mainfrom
dyc3/yaml-fmt-flow-mappings
Jul 23, 2026
Merged

feat(format/yaml): flow mappings#11011
dyc3 merged 2 commits into
mainfrom
dyc3/yaml-fmt-flow-mappings

Conversation

@dyc3

@dyc3 dyc3 commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR formats yaml flow mappings.

generated by fable 5

Test Plan

Updated snapshots. We already had some of our own tests that covered the affected syntax.

Docs

@changeset-bot

changeset-bot Bot commented Jul 20, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 865b4d5

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions

Copy link
Copy Markdown
Contributor

✅ Organic activity

No automation signals detected in the analyzed events.

View full analysis →

This is an automated analysis by AgentScan

@github-actions github-actions Bot added A-Parser Area: parser A-Formatter Area: formatter A-Tooling Area: internal tools L-Yaml Language: Yaml labels Jul 20, 2026
@github-actions

github-actions Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Parser conformance results on

js/262

Test result main count This PR count Difference
Total 53430 53430 0
Passed 52149 52149 0
Failed 1239 1239 0
Panics 42 42 0
Coverage 97.60% 97.60% 0.00%

jsx/babel

Test result main count This PR count Difference
Total 38 38 0
Passed 37 37 0
Failed 1 1 0
Panics 0 0 0
Coverage 97.37% 97.37% 0.00%

markdown/commonmark

Test result main count This PR count Difference
Total 652 652 0
Passed 652 652 0
Failed 0 0 0
Panics 0 0 0
Coverage 100.00% 100.00% 0.00%

symbols/microsoft

Test result main count This PR count Difference
Total 5467 5467 0
Passed 1915 1915 0
Failed 3552 3552 0
Panics 0 0 0
Coverage 35.03% 35.03% 0.00%

ts/babel

Test result main count This PR count Difference
Total 676 676 0
Passed 592 592 0
Failed 84 84 0
Panics 0 0 0
Coverage 87.57% 87.57% 0.00%

ts/microsoft

Test result main count This PR count Difference
Total 18876 18876 0
Passed 13010 13010 0
Failed 5865 5865 0
Panics 1 1 0
Coverage 68.92% 68.92% 0.00%

@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 55868d49-c394-4aa1-8c8b-46671ac00ab3

📥 Commits

Reviewing files that changed from the base of the PR and between 865b4d5 and c86c648.

⛔ Files ignored due to path filters (3)
  • crates/biome_yaml_formatter/tests/specs/prettier/yaml/flow-mapping/middle-comments.yml.snap is excluded by !**/*.snap and included by **
  • crates/biome_yaml_formatter/tests/specs/prettier/yaml/flow-sequence/middle-comments.yml.snap is excluded by !**/*.snap and included by **
  • crates/biome_yaml_formatter/tests/specs/yaml/flow/collection_key.yaml.snap is excluded by !**/*.snap and included by **
📒 Files selected for processing (6)
  • crates/biome_yaml_formatter/src/yaml/auxiliary/block_map_implicit_entry.rs
  • crates/biome_yaml_formatter/src/yaml/auxiliary/flow_map_explicit_entry.rs
  • crates/biome_yaml_formatter/src/yaml/auxiliary/flow_map_implicit_entry.rs
  • crates/biome_yaml_formatter/src/yaml/auxiliary/flow_mapping.rs
  • crates/biome_yaml_formatter/src/yaml/auxiliary/flow_sequence.rs
  • crates/biome_yaml_formatter/tests/specs/yaml/flow/collection_key.yaml
🚧 Files skipped from review as they are similar to previous changes (1)
  • crates/biome_yaml_formatter/src/yaml/auxiliary/block_map_implicit_entry.rs

Walkthrough

The YAML formatter adds flow-collection detection and optional trailing commas for flow-map entry lists. Flow mappings and entries now use structured, comment-aware layouts with controlled indentation, separators, and explicit ? key : value formatting. Implicit entries share helpers for collection keys, values, colon spacing, and comment-driven breaks. Comment placement recognises explicit flow-map entries, and a fixture covers collection-key formatting.

Possibly related PRs

Suggested reviewers: ematipico

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main change: YAML flow mapping formatting.
Description check ✅ Passed The description is directly related and accurately summarises the YAML flow mapping formatter work.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dyc3/yaml-fmt-flow-mappings

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 Checkov (3.3.8)
crates/biome_yaml_formatter/tests/specs/yaml/flow/collection_key.yaml

Traceback (most recent call last):
File "/usr/local/bin/checkov", line 2, in
from checkov.main import Checkov
ModuleNotFoundError: No module named 'checkov'


Comment @coderabbitai help to get the list of available commands.

dyc3 commented Jul 21, 2026

Copy link
Copy Markdown
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@ematipico ematipico left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comments to review, and patterns to change.

Comment thread crates/biome_yaml_formatter/src/yaml/auxiliary/block_map_implicit_entry.rs Outdated
Comment thread crates/biome_yaml_formatter/src/yaml/auxiliary/flow_map_explicit_entry.rs Outdated
Comment thread crates/biome_yaml_formatter/src/yaml/auxiliary/flow_map_explicit_entry.rs Outdated
Comment thread crates/biome_yaml_formatter/src/yaml/auxiliary/flow_map_explicit_entry.rs Outdated
Comment thread crates/biome_yaml_formatter/src/yaml/auxiliary/flow_map_explicit_entry.rs Outdated
Comment thread crates/biome_yaml_formatter/src/yaml/auxiliary/flow_map_implicit_entry.rs Outdated
Comment thread crates/biome_yaml_formatter/src/yaml/auxiliary/flow_map_implicit_entry.rs Outdated
Comment thread crates/biome_yaml_formatter/src/yaml/auxiliary/flow_map_implicit_entry.rs Outdated
Comment thread crates/biome_yaml_formatter/src/yaml/auxiliary/flow_map_implicit_entry.rs Outdated
Comment thread crates/biome_yaml_formatter/src/yaml/auxiliary/flow_mapping.rs Outdated
@dyc3
dyc3 merged commit ede869c into main Jul 23, 2026
28 checks passed
@dyc3
dyc3 deleted the dyc3/yaml-fmt-flow-mappings branch July 23, 2026 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Formatter Area: formatter A-Parser Area: parser A-Tooling Area: internal tools L-Yaml Language: Yaml

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants