Skip to content

Cop suggestion: Sorbet/StructPropName for T::Struct properties #237

@marknuzz

Description

@marknuzz

It would be great to have a cop that works like Naming/MethodName, but for T::Struct props

Personally I only plan to use snake_case for this right now, but for completeness the cop could support the same options as Naming/MethodName.

Naming/MethodName source: https://github.com/rubocop/rubocop/blob/master/lib/rubocop/cop/naming/method_name.rb

Example:

class Foo < T::Struct
  const :fooConst, String # bad
  const :foo_const, String # good
  
  prop :fooProp, T::Boolean # bad
  prop :foo_prop, T::Boolean # good
end

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