Skip to content

bin/sort is broken #918

@pocke

Description

@pocke
  • It is not aware of constants in the class definition
  • It changes method visibility

We can fix the first problem easily. We just need to add a when clause to group method.

The second problem is more difficult. Currently bin/sort brings up all private and public members. For example:

class C
  private
  def foo: -> void
  public
  def bar: -> void
end

# by bin/sort ↓

class C
  private

  public
  def bar: () -> void
  def foo: () -> void
end

So it should be aware of method visibility. I have two solution ideas.

  • List all public methods, then list all private methods.
  • Use private def foo ... syntax for all private methods.

The contribution guide mentions this script, so we should fix the problem, and the script should print the "standard" style of RBS.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions