Skip to content

HAML: Please support multi-line ruby code #1161

@tmaier

Description

@tmaier

Metadata

  • Operating system: Ubuntu
  • Ruby version: latest
  • Node version: latest
  • @prettier/plugin-ruby or prettier gem version: 2.0.0 and 2.5.1
  • Options:
    • rubyArrayLiteral - true
    • rubyHashLabel - true
    • rubyModifier - true
    • rubySingleQuote - true
    • rubyToProc - false
    • trailingComma - "none"

Input

HAML

          = f.input :roles, as: :check_boxes,
                            collection: Role.global_roles,
                            label_method: lambda { |role| I18n.t(role.name, scope: 'rolify.role.roles') },
                            value_method: :name,
                            checked: f.object.roles_name

Current output

          = f.input :roles, as: :check_boxes, collection: Role.global_roles, label_method: lambda { |role| I18n.t(role.name, scope: 'rolify.role.roles') }, value_method: :name, checked: f.object.roles_name

The code above looks for me not really legible, as there is much too much code in one line.

Expected output

It would be great, if HAML/ruby code would be formatted in a way, taking into account the print-width

          = f.input :roles, as: :check_boxes,
                            collection: Role.global_roles,
                            label_method: lambda { |role| I18n.t(role.name, scope: 'rolify.role.roles') },
                            value_method: :name,
                            checked: f.object.roles_name

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