Skip to content

feat(css_formatter): include SCSS comments - #10150

Merged
denbezrukov merged 4 commits into
mainfrom
db/scss-include-comment-fixtures
Apr 29, 2026
Merged

denbezrukov merged 4 commits into
mainfrom
db/scss-include-comment-fixtures

Conversation

@denbezrukov

Copy link
Copy Markdown
Contributor

This PR was prepared with AI assistance from Codex.

Summary

Aligns SCSS @include argument comment placement with Prettier.

This covers inline, own-line, nested list/map/parenthesized comments, and comments before closing include argument groups.

Example output:

@include inline-comments(
	1px,
	/* after positional block */
	$very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-arg:
		1px,
	// after keyword line
	2px 4px 6px /* before close */
);

@include nested-map-separator-line-comments(
	$map-separator: (
		a: 1px, // map separator line
		b: 2px,
	)
);

@include direct-final-outer-closing-comments(
	(1px, 2px) /* outer positional list final */,
	fn(1px, 2px) /* outer positional params final */
);

Test Plan

  • cargo test -p biome_css_formatter

@changeset-bot

changeset-bot Bot commented Apr 28, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 739e36d

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 Apr 28, 2026
@denbezrukov denbezrukov changed the title feat(css_formatter): SCSS include separator comments feat(css_formatter): include SCSS separator comments Apr 28, 2026
@denbezrukov denbezrukov changed the title feat(css_formatter): include SCSS separator comments feat(css_formatter): include SCSS comments Apr 28, 2026
@coderabbitai

coderabbitai Bot commented Apr 28, 2026 •

Copy link
Copy Markdown
Contributor

Walkthrough

This PR extends SCSS @include directive comment handling by introducing a new place_separated_list_comment function to classify and position comments within include argument lists, alongside a reusable ScssSeparatorComments wrapper utility. A new fmt_node hook is added to the FormatNodeRule trait, enabling more granular control over node formatting pipelines. Multiple SCSS formatter implementations are updated to route comment and node formatting through the separator comments wrapper, with supporting utilities added for comment classification, include-closing comment spacing, and list expansion logic.

Possibly related PRs

Suggested labels

A-Formatter, L-CSS

Suggested reviewers

  • dyc3
  • ematipico
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description check ✅ Passed The description clearly explains the feature scope (SCSS @include argument comment placement), provides concrete examples, and references the test plan.
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.
Title check ✅ Passed The title accurately captures the main focus of the PR: introducing SCSS comment handling for include directives, which is the primary objective across all modified files.

✏️ 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/scss-include-comment-fixtures

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 Apr 28, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 29 untouched benchmarks
⏩ 227 skipped benchmarks1


Comparing db/scss-include-comment-fixtures (739e36d) with main (c09bb0b)

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. ↩

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.

1 participant