Skip to content

RedundantBlockCall ignores class methods #261

@vlad-pisanov

Description

@vlad-pisanov

Consider:

class C
  def self.foo(&block)
    block.call
  end

  def bar(&block)
    block.call
  end
end

Rubocop flags bar as a RedundantBlockCall offense, but not foo.


Expected behavior

Both foo and bar should be flagged as RedundantBlockCall

RuboCop version

1.22.1 (using Parser 3.0.2.0, rubocop-ast 1.12.0, running on ruby 2.6.6 x86_64-darwin20)
  - rubocop-performance 1.11.5

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions