Skip to content

feat(css_formatter): keep SCSS scalar parentheses inline - #10599

Merged
denbezrukov merged 2 commits into
mainfrom
db/formatter-scss-34
Jun 9, 2026
Merged

denbezrukov merged 2 commits into
mainfrom
db/formatter-scss-34

Conversation

@denbezrukov

@denbezrukov denbezrukov commented Jun 9, 2026 •

Copy link
Copy Markdown
Contributor

This PR was implemented with AI assistance.

Summary

Keep SCSS scalar parentheses inline instead of formatting them as one-item lists in map values and include keyword arguments.

@include container($foo: 2 * ($bar));
@include container(
  $foo: (
    $bar,
    $baz,
  )
);

$map: (
  key: (value),
  other-key: (
    key: other-other-value,
  ),
);

$key-values: (
  ("key": "value"): ("list"),
);

Test Plan

  • cargo test -p biome_css_formatter

@github-actions

github-actions Bot commented Jun 9, 2026

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

@changeset-bot

changeset-bot Bot commented Jun 9, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 3785894

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 github-actions Bot added A-Formatter Area: formatter L-CSS Language: CSS and super languages labels Jun 9, 2026
@coderabbitai

coderabbitai Bot commented Jun 9, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

This PR refactors SCSS parenthesised expression and list formatting in the Biome CSS formatter. The changes move from comma-ownership heuristics to payload-kind detection (list-shape vs. map) for deciding expansion and trailing-comma insertion. A shared has_scss_list_shape helper was extracted to centralise list-shape definition, and both the parenthesised expression formatter and list layout logic were updated to use the new predicates consistently.

Possibly related PRs

  • biomejs/biome#10207: Introduces parenthesized map-key list detection in scss_list_layout.rs used by the same parenthesized map formatting paths.
  • biomejs/biome#10282: Updates parenthesized_expression.rs to change map/list detection and trailing-comma helper logic in the same formatter module.
  • biomejs/biome#10269: Refactors parenthesised-expression and @include-list logic in both affected modules using shared list-shape and include-parentheses classification.

Suggested labels

A-Formatter, L-CSS

Suggested reviewers

  • dyc3
  • ematipico
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: keeping SCSS scalar parentheses inline rather than formatting them as lists.
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.
Description check ✅ Passed The pull request description clearly relates to the changeset, explaining the goal of keeping SCSS scalar parentheses inline and providing relevant code examples.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch db/formatter-scss-34

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@codspeed

codspeed Bot commented Jun 9, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 29 untouched benchmarks
⏩ 227 skipped benchmarks1


Comparing db/formatter-scss-34 (3785894) with main (5c016d5)2

Open in CodSpeed

Footnotes

  1. 227 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

  2. No successful run was found on main (9669424) during the generation of this report, so 5c016d5 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩

@denbezrukov
denbezrukov merged commit 8fa36d9 into main Jun 9, 2026
32 checks passed
@denbezrukov
denbezrukov deleted the db/formatter-scss-34 branch June 9, 2026 16:11
THernandez03 pushed a commit to THernandez03/biome that referenced this pull request Jun 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Formatter Area: formatter L-CSS Language: CSS and super languages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants