Skip to content

Style/HashAsLastArrayItem does not mark implicit hashes #14841

@grosser

Description

@grosser

Steps to reproduce the problem

Style/HashAsLastArrayItem:
  EnforcedStyle: braces

and code

# frozen_string_literal: true
class Foo
  A = [
    a: 1
  ].freeze
end

Expected behavior

The hash should be marked as invalid since it should be [{a:1}]

Actual behavior

not marked

RuboCop version

1.84.1

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