Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Numbered parameters #885

Open
Open
@Hugo-Hache

Description

@Hugo-Hache

Following myPR introducing a cop for numbered parameters,@koicsuggested that choosing the default style required a discussion in the style guide.

As a basis, here is what we agreed upon in our team. "Explicit" array name is not per se enforcable with a cop, so I'm not sure how it would fit in the guide.

# bad - non explicit array nameresults = electric_appliance.process!results.each { _1.taste }# bad - multi line blockwaffles.each do   topping = @user.toppings.max_by(&:evaluation)  _1.spread toppingend# bad - block can be created from methodwaffles.each { _1.taste } # => waffles.each(&:taste)waffles.each { taste(_1) } # => waffles.each(&method(:taste))# good - explicit array name + single line block + necessity to write blockwaffles.each { _1.spread(jam) }waffles.filter { _1.baking == :well_done }

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


      [8]ページ先頭

      ©2009-2025 Movatter.jp