Skip to content

Keyword argument(s) in parenthesis-less method definition result in invalid code #331

@pjg

Description

@pjg

Ruby 3.2.5
rufo 0.18.0

parens_in_def :dynamic
quote_style :single
class User
  def self.by_uid uid:
    joins(:authentications).where(authentications: { uid: }).first
  end
end
rufo app/models/user.rb

results in broken ruby code (all squashed into a single line):

class X
  def self.by_uid uid: joins(:authentications).where(authentications: { uid: }).first end
end
circular argument reference - uid
.../app/models/user.rb:2: syntax error, unexpected `end', expecting ';' or '\n'
...ntications: { uid: }).first end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions