Closed HS-157 closed 3 years ago
But why if it's also a last element?
a = {
toto: 'toto',
titi: <<~EOS
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Nam euismod erat eget lorem dignissim ornare.
Ut pellentesque nisi nec ipsum sagittis volutpat vel vitae lorem.
EOS,
tutu: 'tutu'
}
Would that cop flag this code and suggest changing to this?
a = {
toto: 'toto',
- titi: <<~EOS
+ titi: <<~EOS,
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Nam euismod erat eget lorem dignissim ornare.
Ut pellentesque nisi nec ipsum sagittis volutpat vel vitae lorem.
- EOS,
+ EOS
tutu: 'tutu'
}
Closing as stale
Huhu,
I have a multi-line string and I use a heredoc in hash for a cookbook Chef. For check style, I use Cookstyle as linting tool, it raise Style/TrailingCommaInHashLiteral as warning cops.
I would like to know if this is a good practice add comma after first line delimiter when a heredoc use in a hash like add a parenthesis when it's use as argument in a function.
Thank you.
Example
Cookstyle warning
Cookstyle OK