Skip to content

refactor(formatter): Share fixtures test harness and test formatter_json#22676

Merged
graphite-app[bot] merged 1 commit into
mainfrom
05-22-refactor_formatter_share_fixtures_test_harness_and_test_formatter_json
May 29, 2026
Merged

refactor(formatter): Share fixtures test harness and test formatter_json#22676
graphite-app[bot] merged 1 commit into
mainfrom
05-22-refactor_formatter_share_fixtures_test_harness_and_test_formatter_json

Conversation

@leaysgur

@leaysgur leaysgur commented May 22, 2026

Copy link
Copy Markdown
Member

Extract the fixture-based snapshot test harness from oxc_formatter into two oxc_formatter_core modules behind a test_harness feature:

  • test_support/codegen:
    • Language-agnostic build.rs helper that walks tests/fixtures/ and emits #[test] functions to $OUT_DIR
    • Extension allowlist is now a parameter instead of hardcoded JS types.
  • test_support/harness:
    • Snapshot-runtime that drives one format pass per option set × per printWidth (80, 100) and asserts via insta
    • Per-language hook is the new FixtureFormatter trait

@github-actions github-actions Bot added the A-formatter Area - Formatter label May 22, 2026

leaysgur commented May 22, 2026

Copy link
Copy Markdown
Member Author

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 changes, fast-track this PR to the front of the merge queue

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.

@leaysgur leaysgur changed the title refactor(formatter): Share fixtures test harness and test formatter_json refactor(formatter): Share fixtures test harness and test formatter_json May 22, 2026
@leaysgur leaysgur force-pushed the 05-22-tasks_conformance_add_json_prettier_conformance branch from f9561dd to d02ce5d Compare May 22, 2026 08:14
@leaysgur leaysgur force-pushed the 05-22-refactor_formatter_share_fixtures_test_harness_and_test_formatter_json branch 2 times, most recently from e62d84c to 1b46616 Compare May 22, 2026 08:17
@codspeed-hq

codspeed-hq Bot commented May 22, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 57 untouched benchmarks


Comparing 05-22-refactor_formatter_share_fixtures_test_harness_and_test_formatter_json (f660c95) with 05-22-tasks_conformance_add_json_prettier_conformance (a02c1d6)1

Open in CodSpeed

Footnotes

  1. No successful run was found on 05-22-tasks_conformance_add_json_prettier_conformance (39fdc17) during the generation of this report, so 6979b60 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@leaysgur leaysgur force-pushed the 05-22-refactor_formatter_share_fixtures_test_harness_and_test_formatter_json branch 4 times, most recently from 2e11123 to 65512a5 Compare May 25, 2026 00:38
@leaysgur leaysgur force-pushed the 05-22-tasks_conformance_add_json_prettier_conformance branch 2 times, most recently from 3f98531 to de2a7f4 Compare May 25, 2026 02:10
@leaysgur leaysgur force-pushed the 05-22-refactor_formatter_share_fixtures_test_harness_and_test_formatter_json branch 2 times, most recently from 489ac04 to c85c661 Compare May 25, 2026 02:20
@leaysgur leaysgur force-pushed the 05-22-tasks_conformance_add_json_prettier_conformance branch from de2a7f4 to 87de790 Compare May 25, 2026 02:20
@leaysgur leaysgur force-pushed the 05-22-refactor_formatter_share_fixtures_test_harness_and_test_formatter_json branch from c85c661 to fbd7d62 Compare May 25, 2026 05:51
@leaysgur leaysgur force-pushed the 05-22-tasks_conformance_add_json_prettier_conformance branch from 87de790 to 3385f17 Compare May 25, 2026 05:51
@leaysgur leaysgur force-pushed the 05-22-tasks_conformance_add_json_prettier_conformance branch from 3385f17 to ebbcfe6 Compare May 25, 2026 07:49
@leaysgur leaysgur force-pushed the 05-22-refactor_formatter_share_fixtures_test_harness_and_test_formatter_json branch from fbd7d62 to 0e10ae2 Compare May 25, 2026 07:49
@leaysgur leaysgur force-pushed the 05-22-tasks_conformance_add_json_prettier_conformance branch from ebbcfe6 to 9d067bc Compare May 25, 2026 07:50
@leaysgur leaysgur force-pushed the 05-22-refactor_formatter_share_fixtures_test_harness_and_test_formatter_json branch 2 times, most recently from 274376b to a03b6d8 Compare May 25, 2026 08:06
@leaysgur leaysgur force-pushed the 05-22-tasks_conformance_add_json_prettier_conformance branch 2 times, most recently from 6800406 to d80375a Compare May 25, 2026 08:35
@leaysgur leaysgur force-pushed the 05-22-refactor_formatter_share_fixtures_test_harness_and_test_formatter_json branch from a03b6d8 to a2da9c2 Compare May 25, 2026 08:35
@leaysgur leaysgur force-pushed the 05-22-refactor_formatter_share_fixtures_test_harness_and_test_formatter_json branch from 8c1fe42 to 6b9d0af Compare May 25, 2026 11:25
@leaysgur leaysgur force-pushed the 05-22-tasks_conformance_add_json_prettier_conformance branch 2 times, most recently from 674f56f to 9cbe86d Compare May 26, 2026 06:24
@leaysgur leaysgur force-pushed the 05-22-refactor_formatter_share_fixtures_test_harness_and_test_formatter_json branch 3 times, most recently from a5729cc to b46a590 Compare May 26, 2026 08:21
@leaysgur leaysgur force-pushed the 05-22-tasks_conformance_add_json_prettier_conformance branch from 9cbe86d to 1d9ec03 Compare May 26, 2026 08:21
@leaysgur leaysgur force-pushed the 05-22-refactor_formatter_share_fixtures_test_harness_and_test_formatter_json branch from b46a590 to e60c2cf Compare May 28, 2026 00:44
@leaysgur leaysgur force-pushed the 05-22-tasks_conformance_add_json_prettier_conformance branch from 1d9ec03 to 12d19d1 Compare May 28, 2026 00:44
@leaysgur leaysgur force-pushed the 05-22-refactor_formatter_share_fixtures_test_harness_and_test_formatter_json branch from e60c2cf to ddcfca5 Compare May 28, 2026 02:33
@leaysgur leaysgur force-pushed the 05-22-tasks_conformance_add_json_prettier_conformance branch 2 times, most recently from 8923568 to 5371b7b Compare May 28, 2026 06:46
@leaysgur leaysgur force-pushed the 05-22-refactor_formatter_share_fixtures_test_harness_and_test_formatter_json branch 2 times, most recently from 0d97724 to 6816b91 Compare May 28, 2026 07:14
@leaysgur leaysgur force-pushed the 05-22-tasks_conformance_add_json_prettier_conformance branch 2 times, most recently from de845b0 to a02c1d6 Compare May 28, 2026 07:29
@leaysgur leaysgur force-pushed the 05-22-refactor_formatter_share_fixtures_test_harness_and_test_formatter_json branch 2 times, most recently from 3d3c823 to f660c95 Compare May 29, 2026 00:27
@leaysgur leaysgur marked this pull request as ready for review May 29, 2026 00:48
@leaysgur leaysgur requested a review from Dunqing as a code owner May 29, 2026 00:48
@graphite-app graphite-app Bot added the 0-merge Merge with Graphite Merge Queue label May 29, 2026
@graphite-app

graphite-app Bot commented May 29, 2026

Copy link
Copy Markdown
Contributor

Merge activity

…json` (#22676)

Extract the fixture-based snapshot test harness from `oxc_formatter` into two `oxc_formatter_core` modules behind a `test_harness` feature:

- `test_support/codegen`:
  - Language-agnostic `build.rs` helper that walks `tests/fixtures/` and emits `#[test]` functions to `$OUT_DIR`
  - Extension allowlist is now a parameter instead of hardcoded JS types.
- `test_support/harness`:
  - Snapshot-runtime that drives one format pass per option set × per printWidth (80, 100) and asserts via `insta`
  - Per-language hook is the new `FixtureFormatter` trait
@graphite-app graphite-app Bot force-pushed the 05-22-tasks_conformance_add_json_prettier_conformance branch from 39fdc17 to e12e1fc Compare May 29, 2026 00:51
@graphite-app graphite-app Bot requested a review from overlookmotel as a code owner May 29, 2026 00:51
@graphite-app graphite-app Bot force-pushed the 05-22-refactor_formatter_share_fixtures_test_harness_and_test_formatter_json branch from f660c95 to e4a89ec Compare May 29, 2026 00:51
@graphite-app graphite-app Bot removed the 0-merge Merge with Graphite Merge Queue label May 29, 2026
Base automatically changed from 05-22-tasks_conformance_add_json_prettier_conformance to main May 29, 2026 00:58
@graphite-app graphite-app Bot merged commit e4a89ec into main May 29, 2026
32 checks passed
@graphite-app graphite-app Bot deleted the 05-22-refactor_formatter_share_fixtures_test_harness_and_test_formatter_json branch May 29, 2026 00:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-formatter Area - Formatter

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant