Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 17, 2025

Addresses post-merge review feedback on #14939.

Changes

  • Optimize Oxlintrc::merge signature: Take ownership of other parameter instead of borrowing, avoiding unnecessary clone since caller owns the value
  • Remove redundant clones: Use owned fields directly (other.categories, other.overrides)
  • Clarify merge semantics: Expand documentation with concrete example showing self wins when both configs define the same property
  • Fix documentation format: Use inline code blocks for JSON examples instead of a code block with comments

Previously confusing which config took precedence; documentation now makes the behavior explicit and clear.

Original prompt

review the code review comments on #14939 (comment) and action them


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@graphite-app
Copy link
Contributor

graphite-app bot commented Nov 17, 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.

- Revert merge signature to take ownership instead of reference
- Update call site to pass ownership
- Avoid unnecessary clones by using owned values
- Expand comment with example showing merge priority

Co-authored-by: camc314 <[email protected]>
Copilot AI changed the title [WIP] Address code review comments for pull request 14939 refactor(linter): optimize merge method and clarify precedence semantics Nov 17, 2025
Copilot AI requested a review from camc314 November 17, 2025 14:14
Copilot finished work on behalf of camc314 November 17, 2025 14:14
@camc314 camc314 marked this pull request as ready for review November 17, 2025 14:26
Copilot AI review requested due to automatic review settings November 17, 2025 14:26
@camc314 camc314 assigned overlookmotel and unassigned camc314 and Copilot Nov 17, 2025
Copilot finished reviewing on behalf of camc314 November 17, 2025 14:29
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 refactors the Oxlintrc::merge method to improve performance and clarify merge semantics based on post-merge review feedback.

  • Optimized merge method signature to take ownership of other parameter instead of borrowing
  • Removed unnecessary clones of owned fields (categories and overrides)
  • Enhanced documentation with concrete example showing precedence semantics (self wins over other)

Reviewed Changes

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

File Description
crates/oxc_linter/src/config/oxlintrc.rs Updated merge method signature to take ownership and removed redundant clones; expanded documentation with precedence example
crates/oxc_linter/src/config/config_builder.rs Updated call site to pass owned value instead of reference to match new signature

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 225 to 230
/// ```
/// // If self has: { "rules": { "no-console": "error" } }
/// // and other has: { "rules": { "no-console": "warn", "no-debugger": "error" } }
/// // Result will be: { "rules": { "no-console": "error", "no-debugger": "error" } }
/// // (self's "no-console" setting wins)
/// ```
Copy link

Copilot AI Nov 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code block in this documentation example should specify a language tag or use ignore to prevent rustdoc from attempting to compile it as a Rust test. The current format will cause doc test failures.

Suggested fix:

/// # Example
///
/// ```ignore
/// // If self has: { "rules": { "no-console": "error" } }
/// // and other has: { "rules": { "no-console": "warn", "no-debugger": "error" } }
/// // Result will be: { "rules": { "no-console": "error", "no-debugger": "error" } }
/// // (self's "no-console" setting wins)
/// ```

Copilot uses AI. Check for mistakes.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot fix this, what's there currently doesn't really make sense. You've put a code block, with just comments inside. Perhaps use inline code block for just the json? or something else?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 1857911. Replaced the code block with inline code blocks for the JSON examples to make the documentation clearer.

Replace code block with only comments with inline code blocks for JSON examples to make the documentation clearer and prevent rustdoc errors.

Co-authored-by: camc314 <[email protected]>
Copilot finished work on behalf of camc314 November 17, 2025 14:42
Copilot AI requested a review from camc314 November 17, 2025 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants