Skip to content

Conversation

@Boshen
Copy link
Member

@Boshen Boshen commented Sep 27, 2025

Summary

Changes

  • Configure Driver::codegen_options() to use spaces with width 2
  • Configure TestCase Codegen instance to use spaces with width 2
  • Remove three instances of cow_replace("\t", " ") hack
  • Add IndentChar imports where needed

Context

The CodegenOptions struct already had indent_char and indent_width fields available. This change leverages existing infrastructure to provide cleaner, more maintainable code instead of post-processing the output with string replacement.

This addresses the issue mentioned in #14236 where transformer conformance output was replacing tabs with spaces as a workaround.

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings September 27, 2025 16:22
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 PR replaces manual tab-to-space string replacement workarounds with proper native indentation configuration in the transformer conformance testing code.

  • Configures CodegenOptions to use spaces with width 2 instead of post-processing tabs
  • Removes three instances of cow_replace("\t", " ") string replacement calls
  • Adds necessary IndentChar imports to support the configuration

Reviewed Changes

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

File Description
tasks/transform_conformance/src/test_case.rs Removes tab-to-space replacements and configures Codegen with space indentation
tasks/transform_conformance/src/driver.rs Configures Driver's codegen options to use space indentation

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@graphite-app
Copy link
Contributor

graphite-app bot commented Sep 27, 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.

@github-actions github-actions bot added A-transformer Area - Transformer / Transpiler C-enhancement Category - New feature or request labels Sep 27, 2025
@Boshen Boshen force-pushed the feat/transformer-native-indent-config branch from e1bf175 to 434cd6e Compare September 27, 2025 16:26
@Boshen Boshen added the 0-merge Merge with Graphite Merge Queue label Sep 27, 2025
Copy link
Member Author

Boshen commented Sep 27, 2025

Merge activity

@Boshen Boshen added 0-merge Merge with Graphite Merge Queue and removed 0-merge Merge with Graphite Merge Queue labels Sep 28, 2025
…guration (#14191)

## Summary
- Closes oxc-project/backlog#150
- Replaces manual tab-to-space replacement hack with native indentation configuration

## Changes
- Configure `Driver::codegen_options()` to use spaces with width 2
- Configure `TestCase` Codegen instance to use spaces with width 2
- Remove three instances of `cow_replace("\t", "  ")` hack
- Add `IndentChar` imports where needed

## Context
The `CodegenOptions` struct already had `indent_char` and `indent_width` fields available. This change leverages existing infrastructure to provide cleaner, more maintainable code instead of post-processing the output with string replacement.

This addresses the issue mentioned in oxc-project/backlog#150 where transformer conformance output was replacing tabs with spaces as a workaround.

🤖 Generated with [Claude Code](https://claude.ai/code)
@graphite-app graphite-app bot force-pushed the feat/transformer-native-indent-config branch from 52db5a1 to 5dcc64c Compare September 28, 2025 02:00
@graphite-app graphite-app bot merged commit 5dcc64c into main Sep 28, 2025
19 checks passed
@graphite-app graphite-app bot deleted the feat/transformer-native-indent-config branch September 28, 2025 02:06
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Sep 28, 2025
taearls pushed a commit to taearls/oxc that referenced this pull request Sep 28, 2025
…guration (oxc-project#14191)

## Summary
- Closes oxc-project/backlog#150
- Replaces manual tab-to-space replacement hack with native indentation configuration

## Changes
- Configure `Driver::codegen_options()` to use spaces with width 2
- Configure `TestCase` Codegen instance to use spaces with width 2
- Remove three instances of `cow_replace("\t", "  ")` hack
- Add `IndentChar` imports where needed

## Context
The `CodegenOptions` struct already had `indent_char` and `indent_width` fields available. This change leverages existing infrastructure to provide cleaner, more maintainable code instead of post-processing the output with string replacement.

This addresses the issue mentioned in oxc-project/backlog#150 where transformer conformance output was replacing tabs with spaces as a workaround.

🤖 Generated with [Claude Code](https://claude.ai/code)
taearls pushed a commit to taearls/oxc that referenced this pull request Sep 28, 2025
…guration (oxc-project#14191)

## Summary
- Closes oxc-project/backlog#150
- Replaces manual tab-to-space replacement hack with native indentation configuration

## Changes
- Configure `Driver::codegen_options()` to use spaces with width 2
- Configure `TestCase` Codegen instance to use spaces with width 2
- Remove three instances of `cow_replace("\t", "  ")` hack
- Add `IndentChar` imports where needed

## Context
The `CodegenOptions` struct already had `indent_char` and `indent_width` fields available. This change leverages existing infrastructure to provide cleaner, more maintainable code instead of post-processing the output with string replacement.

This addresses the issue mentioned in oxc-project/backlog#150 where transformer conformance output was replacing tabs with spaces as a workaround.

🤖 Generated with [Claude Code](https://claude.ai/code)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-transformer Area - Transformer / Transpiler C-enhancement Category - New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Transformer: transformer conformance output replaces tabs with spaces

2 participants