refactor(rust): rename comments to legal_comments#4442
Merged
Conversation
Member
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
✅ Deploy Preview for rolldown-rs canceled.
|
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the codebase to rename the "comments" option to "legal_comments" throughout the JSON schema, Rust modules, and test configurations.
- Updated JSON schema definitions and enum references from "comments" to "legalComments".
- Modified Rust modules and normalization functions to use the LegalComments enum instead of Comments.
- Adjusted test snapshots and configuration files to reflect the name change.
Reviewed Changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| crates/rolldown_testing/_config.schema.json | Renamed JSON property "comments" to "legalComments" and updated its definition. |
| crates/rolldown_common/src/module/normal_module.rs | Updated match expressions to use LegalComments variants while retaining variable names. |
| crates/rolldown_common/src/lib.rs | Changed import from Comments to LegalComments. |
| crates/rolldown_common/src/inner_bundler_options/types/normalized_bundler_options.rs | Updated the type from Comments to LegalComments (field name remains unchanged). |
| crates/rolldown_common/src/inner_bundler_options/types/comments.rs | Renamed the enum from Comments to LegalComments and updated its Display impl. |
| crates/rolldown_common/src/inner_bundler_options/mod.rs | Updated BundlerOptions to use legal_comments instead of comments. |
| crates/rolldown_binding/src/utils/normalize_binding_options.rs | Renamed the option field to legal_comments and updated the mapping for LegalComments. |
| crates/rolldown/tests/snapshots/integration_rolldown__filename_with_hash.snap | Adjusted test snapshot keys from comments to legalComments. |
| Relevant test config files | Updated configuration keys from "comments" to "legalComments". |
| crates/rolldown/src/utils/normalize_options.rs | Modified normalization to extract legal_comments instead of comments. |
Comments suppressed due to low confidence (2)
crates/rolldown_common/src/module/normal_module.rs:222
- [nitpick] The local variable name 'comments' may be misleading now that the enum is LegalComments; consider renaming it to 'legal_comments' for clarity and consistency.
let comments = match options.comments {
crates/rolldown_common/src/inner_bundler_options/types/normalized_bundler_options.rs:88
- [nitpick] For consistency with the renamed raw option (legal_comments), consider renaming this field to 'legal_comments' in the NormalizedBundlerOptions struct.
pub comments: LegalComments,
Contributor
Benchmarks Rust |
410e5fa to
3e70b4b
Compare
7543ca3 to
3e70b4b
Compare
3e70b4b to
00ed588
Compare
shulaoda
approved these changes
May 8, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
This is the start of porting the same functionality
legalCommentsfrom esbuild.