Skip to content

fix(dx/codegen): don't insert module into biome_rule_options/src/lib.rs if it already exists - #8847

Merged
ematipico merged 1 commit into
mainfrom
dyc3/fix-dupe-rule-options-codegen
Jan 23, 2026
Merged

fix(dx/codegen): don't insert module into biome_rule_options/src/lib.rs if it already exists#8847
ematipico merged 1 commit into
mainfrom
dyc3/fix-dupe-rule-options-codegen

Conversation

@dyc3

@dyc3 dyc3 commented Jan 23, 2026

Copy link
Copy Markdown
Contributor

Summary

fixes #7703

Test Plan

manually tested

Docs

@changeset-bot

changeset-bot Bot commented Jan 23, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 160dc38

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions github-actions Bot added the A-Tooling Area: internal tools label Jan 23, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Parser conformance results on

js/262

Test result main count This PR count Difference
Total 52832 52832 0
Passed 51614 51614 0
Failed 1176 1176 0
Panics 42 42 0
Coverage 97.69% 97.69% 0.00%

jsx/babel

Test result main count This PR count Difference
Total 38 38 0
Passed 37 37 0
Failed 1 1 0
Panics 0 0 0
Coverage 97.37% 97.37% 0.00%

symbols/microsoft

Test result main count This PR count Difference
Total 6300 6300 0
Passed 2085 2085 0
Failed 4215 4215 0
Panics 0 0 0
Coverage 33.10% 33.10% 0.00%

ts/babel

Test result main count This PR count Difference
Total 626 626 0
Passed 560 560 0
Failed 66 66 0
Panics 0 0 0
Coverage 89.46% 89.46% 0.00%

ts/microsoft

Test result main count This PR count Difference
Total 18854 18854 0
Passed 14053 14053 0
Failed 4800 4800 0
Panics 1 1 0
Coverage 74.54% 74.54% 0.00%

@coderabbitai

coderabbitai Bot commented Jan 23, 2026

Copy link
Copy Markdown
Contributor

Walkthrough

The change adds idempotent logic to the code generator's register_analyzer_rule_options function. It checks whether a pub mod declaration already exists in lib.rs before appending a new one, preventing duplicate module declarations. When a module declaration is found to already exist, the function returns early; otherwise, it appends the declaration to the file.

Suggested labels

A-Tooling, A-Linter

Suggested reviewers

  • ematipico
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the fix: preventing duplicate module insertions into lib.rs, which directly addresses the main changeset.
Description check ✅ Passed The description references issue #7703 and mentions manual testing, relating to the codegen fix for duplicate module entries.
Linked Issues check ✅ Passed The changes implement idempotent module declaration logic by checking if a pub mod entry exists before appending, directly addressing issue #7703's requirement.
Out of Scope Changes check ✅ Passed All changes focus on the guard logic in register_analyzer_rule_options function to prevent duplicate module declarations, staying within the scope of fixing issue #7703.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Comment @coderabbitai help to get the list of available commands and usage tips.

@ematipico
ematipico merged commit f6bb010 into main Jan 23, 2026
12 checks passed
@ematipico
ematipico deleted the dyc3/fix-dupe-rule-options-codegen branch January 23, 2026 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Tooling Area: internal tools

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Codegen task appends duplicate entries to biome_rule_options/src/lib.rs for cross-language rules

2 participants