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
@
I'm doing this:
class F def foo @x = Object.new def @x.bar(_t) true end end end
Rubocop 1.64.0 complains:
a.rb:4:5: W: Lint/NestedMethodDefinition: Method definitions must not be nested. Use lambda instead. def @x.bar(_t) ... ^^^^^^^^^^^^^^
Looks like a bug.
More details here: https://stackoverflow.com/questions/78573984/how-to-define-a-ruby-method-in-runtime-so-that-rubocop-doesnt-complain?noredirect=1#comment138524046_78573984
The text was updated successfully, but these errors were encountered:
[Fix rubocop#12960] Fix false positives for `Lint/NestedMethodDefinit…
28603ab
…ion` Fixes rubocop#12960. This PR fixes false positives for `Lint/NestedMethodDefinition` when definition of method on variable. Since method definitions using local variables such as `def obj.y` have already been accepted, the decision is to similarly accept method definitions using other variable types: https://github.com/rubocop/rubocop/blob/v1.64.1/spec/rubocop/cop/lint/nested_method_definition_spec.rb#L80-L89
Lint/NestedMethodDefinition
[Fix #12960] Fix false positives for Lint/NestedMethodDefinition
215bea1
Fixes #12960. This PR fixes false positives for `Lint/NestedMethodDefinition` when definition of method on variable. Since method definitions using local variables such as `def obj.y` have already been accepted, the decision is to similarly accept method definitions using other variable types: https://github.com/rubocop/rubocop/blob/v1.64.1/spec/rubocop/cop/lint/nested_method_definition_spec.rb#L80-L89
@koic thanks!
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
I'm doing this:
Rubocop 1.64.0 complains:
Looks like a bug.
More details here: https://stackoverflow.com/questions/78573984/how-to-define-a-ruby-method-in-runtime-so-that-rubocop-doesnt-complain?noredirect=1#comment138524046_78573984
The text was updated successfully, but these errors were encountered: