Skip to content

Comments

refactor(linter): optimize merge method and clarify precedence semantics#15786

Merged
camc314 merged 4 commits intomainfrom
copilot/action-code-review-comments
Dec 17, 2025
Merged

refactor(linter): optimize merge method and clarify precedence semantics#15786
camc314 merged 4 commits intomainfrom
copilot/action-code-review-comments

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 <18101008+camc314@users.noreply.github.com>
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
@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
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.

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 <18101008+camc314@users.noreply.github.com>
Copilot AI requested a review from camc314 November 17, 2025 14:42
@github-actions github-actions bot added A-linter Area - Linter C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior labels Dec 17, 2025
@camc314 camc314 merged commit 0d18142 into main Dec 17, 2025
19 checks passed
@camc314 camc314 deleted the copilot/action-code-review-comments branch December 17, 2025 12:52
@codspeed-hq
Copy link

codspeed-hq bot commented Dec 17, 2025

CodSpeed Performance Report

Merging #15786 will not alter performance

Comparing copilot/action-code-review-comments (eb8ea81) with main (4cdc2f8)

Summary

✅ 4 untouched
⏩ 41 skipped1

Footnotes

  1. 41 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

qinyuhang pushed a commit to qinyuhang/oxc that referenced this pull request Jan 22, 2026
…ics (oxc-project#15786)

Addresses post-merge review feedback on oxc-project#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.

<!-- START COPILOT CODING AGENT SUFFIX -->



<details>

<summary>Original prompt</summary>

> review the code review comments on
oxc-project#14939 (comment)
and action them


</details>



<!-- START COPILOT CODING AGENT TIPS -->
---

✨ Let Copilot coding agent [set things up for
you](https://github.com/oxc-project/oxc/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot)
— coding agent works faster and does higher quality work when set up for
your repo.

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: camc314 <18101008+camc314@users.noreply.github.com>
Co-authored-by: Cameron <cameron.clark@hey.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-linter Area - Linter C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants