Skip to content

feat(codegen): deduplicate repeated legal comments#11069

Merged
graphite-app[bot] merged 1 commit intomainfrom
05-16-feat_codegen_deduplicate_repeated_legal_comments
May 16, 2025
Merged

feat(codegen): deduplicate repeated legal comments#11069
graphite-app[bot] merged 1 commit intomainfrom
05-16-feat_codegen_deduplicate_repeated_legal_comments

Conversation

@Boshen
Copy link
Member

@Boshen Boshen commented May 16, 2025

related: evanw/esbuild@a54916b

closes #10688

Copilot AI review requested due to automatic review settings May 16, 2025 11:21
Copy link
Member Author

Boshen commented May 16, 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 A-codegen Area - Code Generation C-enhancement Category - New feature or request labels May 16, 2025
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 deduplicates repeated legal comments to streamline the output and improve code efficiency.

  • Removed duplicate legal comment lines in test snapshots.
  • Refactored legal comment handling in the Codegen module by removing the persistent legal_comments field and implementing a function to deduplicate and return legal comments.
  • Updated the comment processing logic to use a hash set for deduplication.

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
crates/oxc_codegen/tests/integration/snapshots/legal_linked_comments.snap Removed duplicate legal comment lines.
crates/oxc_codegen/tests/integration/snapshots/legal_eof_minify_comments.snap Removed duplicate legal comment lines.
crates/oxc_codegen/tests/integration/snapshots/legal_eof_comments.snap Removed duplicate legal comment lines.
crates/oxc_codegen/src/lib.rs Removed the legal_comments field and updated CodegenReturn to use deduplicated legal comments.
crates/oxc_codegen/src/comment.rs Replaced try_print_eof_legal_comments with handle_eof_linked_or_external_comments that deduplicates legal comments.
Comments suppressed due to low confidence (1)

crates/oxc_codegen/src/lib.rs:199

  • Ensure that the removal of the persistent legal_comments field and the shift to a function-based approach does not inadvertently affect other parts of the codebase that might have relied on side effects from the previous implementation.
let legal_comments = self.handle_eof_linked_or_external_comments(program);

@codspeed-hq
Copy link

codspeed-hq bot commented May 16, 2025

CodSpeed Instrumentation Performance Report

Merging #11069 will not alter performance

Comparing 05-16-feat_codegen_deduplicate_repeated_legal_comments (c29b1b8) with main (ef72143)

Summary

✅ 36 untouched benchmarks

@graphite-app
Copy link
Contributor

graphite-app bot commented May 16, 2025

Merge activity

@graphite-app graphite-app bot force-pushed the 05-16-feat_codegen_deduplicate_repeated_legal_comments branch from 325345d to c29b1b8 Compare May 16, 2025 11:50
@graphite-app graphite-app bot merged commit c29b1b8 into main May 16, 2025
25 checks passed
@graphite-app graphite-app bot deleted the 05-16-feat_codegen_deduplicate_repeated_legal_comments branch May 16, 2025 11:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-codegen Area - Code Generation C-enhancement Category - New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

codegen: dedupe legal comments

2 participants