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
send
Lint/RedundantSafeNavigation rule will not offense for send method.
Lint/RedundantSafeNavigation
offense nil&.send(:some_method) code.
nil&.send(:some_method)
test file
# frozen_string_literal: true nil&.send(:some_method) || 0
rubocop will offense this code.
$ rubocop ./test.rb Inspecting 1 file W Offenses: test.rb:3:4: W: [Correctable] Lint/RedundantSafeNavigation: Redundant safe navigation detected. nil&.send(:some_method) || 0 ^^^^^^^^^^^^^^^^^^^^ 1 file inspected, 1 offense detected, 1 offense autocorrectable
$ rubocop -V 1.52.0 (using Parser 3.2.2.1, rubocop-ast 1.28.1, running on ruby 3.0.4) [arm64-darwin22]
$ rubocop -V 1.51.0 (using Parser 3.2.2.1, rubocop-ast 1.28.1, running on ruby 3.0.4) [arm64-darwin22] $ rubocop ./test.rb Inspecting 1 file . 1 file inspected, no offenses detected
The text was updated successfully, but these errors were encountered:
This issue is a dup and resolved by #11915.
Sorry, something went wrong.
oh, Thanks for letting me know.
@bbatsov #11918 has the same issue and is already resolved in #11915. Can you cut the bug fix release at your convenience? (Or I'll take)
No branches or pull requests
Expected behavior
Lint/RedundantSafeNavigation
rule will not offense forsend
method.Actual behavior
offense
nil&.send(:some_method)
code.Steps to reproduce the problem
test file
rubocop will offense this code.
RuboCop version
v1.51.0 is not offense
The text was updated successfully, but these errors were encountered: