KEMBAR78
First parameter indentation rule · Issue #2625 · rubocop/rubocop · GitHub
Skip to content

First parameter indentation rule #2625

@ka8725

Description

@ka8725

I like the following Ruby format to pass parameters into methods:

price = default_price * NightsCalculator.new(
                          start_date,
                          end_date).nights_count

but the FirstParameterIndentation style rule complaints about this. It assumes that only the following variants are possible:

price = default_price * NightsCalculator.new(start_date,
                                             end_date).nights_count

and

price = default_price * NightsCalculator.new(
  start_date,
  end_date).nights_count

But the first one requires more symbols per line. And the second one is not readable in my mind.

What do you think is it make sense to pass code from the my preference?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions