Skip to content

Incorrect autocorrect on Style/MultipleComparison ? #13553

Closed
@mjankowski

Description

@mjankowski

Relevant "before" code (snippet)...

  COLLECTIONS = {
    public: 'https://www.w3.org/ns/activitystreams#Public',
  }.freeze

  def public_collection?(uri)
    uri == COLLECTIONS[:public] || uri == 'as:Public' || uri == 'Public'
  end

Ran autocorrect on 1.69.1, it generates:

  def public_collection?(uri)
    ['as:Public', 'Public'].include?(uri)
  end

Note the removal of COLLECTIONS[:public] here, which seems like an error?

Can provide more context if useful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions