Skip to content

Sorbet: newline inserted between sig and method #253

@bmulholland

Description

@bmulholland

I'm adopting sorbet and adding method signatures. Since these are connected things, I expect them to be grouped together, as you can see in the Sorbet docs: https://sorbet.org/docs/sigs. However, when formatting with rufo, a newline is inserted:

% rufo
# Input
class MyObj
  sig {params(x: Integer).void}
  def initialize(x)
    @y = x  # y has the inferred type Integer
  end
end
# ctrl-d: Output
class MyObj
  sig { params(x: Integer).void }

  def initialize(x)
    @y = x  # y has the inferred type Integer
  end
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