Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

False positive in Lint/SelfAssignment #12435

Closed
ccutrer opened this issue Dec 1, 2023 · 0 comments · Fixed by #12439
Closed

False positive in Lint/SelfAssignment #12435

ccutrer opened this issue Dec 1, 2023 · 0 comments · Fixed by #12439
Labels

Comments

@ccutrer
Copy link
Contributor

ccutrer commented Dec 1, 2023

Expected behavior

A self assignment where the "read" call has parameters should not trigger an offense.

Actual behavior

An offense is triggered, when a parameter is passed. The parameter would imply that this is not a simple reader method, and may be doing some sort of calculation.

Steps to reproduce the problem

# frozen_string_literal: true

f.full_name = f.full_name(true)

rubocop test.rb

RuboCop version

% rubocop -V
1.58.0 (using Parser 3.2.2.4, rubocop-ast 1.30.0, running on ruby 3.1.3) [arm64-darwin21]
@koic koic added the bug label Dec 2, 2023
koic added a commit to koic/rubocop that referenced this issue Dec 2, 2023
Fixes rubocop#12435.

This PR fixes a false positive for `Lint/SelfAssignment`
when using attribute assignment with method call with arguments.
koic added a commit that referenced this issue Dec 5, 2023
…f_assignment

[Fix #12435] Fix a false positive for `Lint/SelfAssignment`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants