trailing commas in multi-line method arguments
- 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
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