We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Style/SelfAssignment
Is there a reason why Style/SelfAssignment only works with variables, as opposed to general expressions? I.e. could we lint for something like:
# bad hash['foo'] = hash['foo'] + 42 user.name = user.name + " Jr." # good hash['foo'] += 42 user.name += " Jr."
The text was updated successfully, but these errors were encountered:
And (see ops):
# bad x = x % 2 x = x ^ 2 x = x << 2 x = x >> 2
# good x %= 2 x ^= 2 x <<= 2 x >>= 2
Sorry, something went wrong.
Lint/SelfAssignment
Make Style/SelfAssignment aware of some operators
2f9a2d2
Follow up rubocop#12410 (comment). This PR makes `Style/SelfAssignment` aware of `%`, `^`, `<<`, and `>>` operators.
The main issue was resolved by #12415, and the derivative will be resolved by #12421.
No branches or pull requests
Is there a reason why
Style/SelfAssignment
only works with variables, as opposed to general expressions? I.e. could we lint for something like:The text was updated successfully, but these errors were encountered: