Skip to content

test(formatter): port printer tests from Biome#15358

Merged
graphite-app[bot] merged 1 commit intomainfrom
11-06-test_formatter_port_printer_tests_from_biome
Nov 7, 2025
Merged

test(formatter): port printer tests from Biome#15358
graphite-app[bot] merged 1 commit intomainfrom
11-06-test_formatter_port_printer_tests_from_biome

Conversation

@Dunqing
Copy link
Member

@Dunqing Dunqing commented Nov 6, 2025

@github-actions github-actions bot added the A-formatter Area - Formatter label Nov 6, 2025
Copy link
Member Author

Dunqing commented Nov 6, 2025


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

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

@github-actions github-actions bot added the C-test Category - Testing. Code is missing test cases, or a PR is adding them label Nov 6, 2025
@codspeed-hq
Copy link

codspeed-hq bot commented Nov 6, 2025

CodSpeed Performance Report

Merging #15358 will not alter performance

Comparing 11-06-test_formatter_port_printer_tests_from_biome (2a64afb) with main (01f20f3)1

Summary

✅ 33 untouched
⏩ 4 skipped2

Footnotes

  1. No successful run was found on main (e061ae3) during the generation of this report, so 01f20f3 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

  2. 4 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.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request adds comprehensive unit tests for the printer module in the oxc_formatter crate and introduces a helper method to simplify test context creation.

  • Adds 16 new test cases covering various printer functionality including groups, indentation, line breaks, fills, and line suffixes
  • Introduces FormatContext::dummy() helper method to streamline test setup
  • Refactors Document::Display implementation to use the new dummy() method

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
crates/oxc_formatter/src/formatter/printer/mod.rs Adds comprehensive test suite for printer functionality including grouping, indentation, line breaking, and special formatting cases
crates/oxc_formatter/src/formatter/context.rs Introduces dummy() helper method for creating test contexts with default values
crates/oxc_formatter/src/formatter/format_element/document.rs Simplifies Display implementation by using the new FormatContext::dummy() method

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@leaysgur leaysgur added 0-merge Merge with Graphite Merge Queue and removed 0-merge Merge with Graphite Merge Queue labels Nov 7, 2025
Copy link
Member

leaysgur commented Nov 7, 2025

Merge activity

@graphite-app graphite-app bot force-pushed the 11-06-test_formatter_port_printer_tests_from_biome branch from 2a64afb to 78abaff Compare November 7, 2025 01:18
@graphite-app graphite-app bot merged commit 78abaff into main Nov 7, 2025
20 checks passed
@graphite-app graphite-app bot deleted the 11-06-test_formatter_port_printer_tests_from_biome branch November 7, 2025 01:25
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Nov 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-formatter Area - Formatter C-test Category - Testing. Code is missing test cases, or a PR is adding them

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants