Skip to content

Discourage using redundant #tap #980

Description

@viralpraxis

Some methods, when well-defined, are known to return self. Kernel#freeze is, perhaps, the most obvious example.

bad:

some_object
  .tap(&:freeze)

good:

some_object
  .freeze

Proposed implementation: rubocop/rubocop#15381

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