Skip to content

Comments

fix(linter/no-unused-private-class-members): correctly detect value context for private members in assignment expressions#15553

Merged
graphite-app[bot] merged 1 commit intomainfrom
c/11-10-fix_linter_no-unused-private-class-members_correctly_detect_value_context_for_private_members_in_assignment_expressions
Nov 10, 2025
Merged

fix(linter/no-unused-private-class-members): correctly detect value context for private members in assignment expressions#15553
graphite-app[bot] merged 1 commit intomainfrom
c/11-10-fix_linter_no-unused-private-class-members_correctly_detect_value_context_for_private_members_in_assignment_expressions

Conversation

@camc314
Copy link
Contributor

@camc314 camc314 commented Nov 10, 2025

fixes #15548

@camc314 camc314 marked this pull request as ready for review November 10, 2025 13:48
Copilot AI review requested due to automatic review settings November 10, 2025 13:48
@github-actions github-actions bot added the A-linter Area - Linter label Nov 10, 2025
@camc314 camc314 self-assigned this Nov 10, 2025
@github-actions github-actions bot added the C-bug Category - Bug label Nov 10, 2025
Copy link
Contributor Author

camc314 commented Nov 10, 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.

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 fixes issue #15548 where private class members used within logical or update expressions on the right-hand side of assignments were incorrectly flagged as unused.

Key changes:

  • Modified is_value_context to accept both parent and child nodes, enabling proper detection of whether an expression is on the RHS of an assignment
  • Added explicit handling for AssignmentExpression in is_value_context to check if the child is within the RHS
  • Refactored variable names for improved clarity (e.g., parent_nodegrandparent)

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

@graphite-app
Copy link
Contributor

graphite-app bot commented Nov 10, 2025

Merge activity

@codspeed-hq
Copy link

codspeed-hq bot commented Nov 10, 2025

CodSpeed Performance Report

Merging #15553 will not alter performance

Comparing c/11-10-fix_linter_no-unused-private-class-members_correctly_detect_value_context_for_private_members_in_assignment_expressions (1b994d1) with main (4d71f45)1

Summary

✅ 4 untouched
⏩ 33 skipped2

Footnotes

  1. No successful run was found on main (1b994d1) during the generation of this report, so 4d71f45 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

  2. 33 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.

…ontext for private members in assignment expressions (#15553)

fixes #15548
@graphite-app graphite-app bot force-pushed the c/11-10-fix_linter_no-unused-private-class-members_correctly_detect_value_context_for_private_members_in_assignment_expressions branch from 4e71e85 to 1b994d1 Compare November 10, 2025 13:58
@graphite-app graphite-app bot merged commit 1b994d1 into main Nov 10, 2025
20 checks passed
@graphite-app graphite-app bot deleted the c/11-10-fix_linter_no-unused-private-class-members_correctly_detect_value_context_for_private_members_in_assignment_expressions branch November 10, 2025 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-linter Area - Linter C-bug Category - Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

linter: False positives for no-unused-private-class-members

1 participant