-
-
Notifications
You must be signed in to change notification settings - Fork 722
feat(transformer): replace tab-to-space hack with native indent configuration #14191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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
CodegenOptionsto use spaces with width 2 instead of post-processing tabs - Removes three instances of
cow_replace("\t", " ")string replacement calls - Adds necessary
IndentCharimports 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.
How to use the Graphite Merge QueueAdd either label to this PR to merge it via 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. |
e1bf175 to
434cd6e
Compare
Merge activity
|
…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)
52db5a1 to
5dcc64c
Compare
…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)
…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)
Summary
Changes
Driver::codegen_options()to use spaces with width 2TestCaseCodegen instance to use spaces with width 2cow_replace("\t", " ")hackIndentCharimports where neededContext
The
CodegenOptionsstruct already hadindent_charandindent_widthfields 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