airbnb / airbnb/ruby

trailing commas in multi-line method arguments

Open
#113 7 comments 0 reactions 0 assignees View on GitHub
Dominant language
Ruby
Stars
3.9k
Forks
756
PR merge metrics
No merged PRs in 30d

Description

Which is the preferred style?

```Ruby
# 1
return I18n.t('Guest Profile Page: A note for the Host saying the potential Guest has '\
'not cancelled a reservation since joining Airbnb.',
:default => '%{guest_name} hasn’t canceled a reservation since joining '\
'Airbnb',
:guest_name => @user.smart_name)
```

or

```Ruby
# 2
return I18n.t('Guest Profile Page: A note for the Host saying the potential Guest has '\
'not cancelled a reservation since joining Airbnb.',
:default => '%{guest_name} hasn’t canceled a reservation since joining '\
'Airbnb',
:guest_name => @user.smart_name,
)
```

or

```Ruby
# 3
return I18n.t(
'Guest Profile Page: A note for the Host saying the potential Guest has '\
'not cancelled a reservation since joining Airbnb.',
:default => '%{guest_name} hasn’t canceled a reservation since joining '\
'Airbnb',
:guest_name => @user.smart_name,
)
```

or

```Ruby
# 4
return I18n.t(
'Guest Profile Page: A note for the Host saying the potential Guest has '\
'not cancelled a reservation since joining Airbnb.',
:default => '%{guest_name} hasn’t canceled a reservation since joining '\
'Airbnb',
:guest_name => @user.smart_name
)
```

Contributor guide

Open the contributing guide

Research direction

Review the four Ruby formatting examples in issue #113 and read the seven-comment discussion for any settled preference. Determine whether the project has documented guidance for trailing commas in multiline method arguments, then update the relevant Ruby Style Guide documentation if a decision can be made.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.