rubocop / rubocop/ruby-style-guide

best practice for long method signatures with many defaults

Open
#289 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
No language data
Stars
16.5k
Forks
3.3k
PR merge metrics
No merged PRs in 30d

Description

I didn't see this defined in the guide, sorry if I'm just not seeing it.

The guide should define a best practice for long method signatures, like:

def do_something(os = 'precise', os_bits = 64, instance_type = 'instance-store', min_priority = 7)
...
end

For example, here are some options:

def do_something(os = 'precise', os_bits = 64,
                 instance_type = 'instance-store', min_priority = 7)
def do_something(os = 'precise',
                 os_bits = 64,
                 instance_type = 'instance-store',
                 min_priority = 7)
def do_something(
  os = 'precise',
  os_bits = 64,
  instance_type = 'instance-store',
  min_priority = 7)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the guide section covering method definitions and review the three long-signature examples in this issue. Resolve which formatting convention the project wants with maintainers, then document the agreed best practice in the guide; done means the guidance clearly covers signatures with many defaults.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
documentation
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.