You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ rubocop -D
Inspecting 1 file
C
Offenses:
indent.rb:5:13: C: Style/MultilineMethodCallBraceLayout: Closing method call brace must be on the line after the last argument.
].join('')
^
1 file inspected, 1 offense detected
Workaround
I can satisfy the cop by changing my ruby to this:
feed('dog food',[dog1,dog2].join(' '))
But I don't think it should be necessary, because the join method call is not multiline
Steps to reproduce the problem
Using the above yaml and ruby code and running rubocop should reproduce the same behavior
* bbatsov/master: (80 commits)
[Fixrubocop#3540] Make `Style/GuardClause` register offense for instance & singleton methods
[Fixrubocop#3436] issue related to Rails/SaveBang when returning non-bang call from the parent method
Allow `#to_yml` to produce single-quoted strings
Add support for StyleGuideBaseURL and update rules
Add spec for the existing style guide URL implementation
Fix the changelog
Edited regular expression for normal case to fix issues rubocop#3514 and rubocop#3516 (rubocop#3524)
Add a rake task for generation a new cop (rubocop#3533)
[Fixrubocop#3510] Various bug fixes for SafeNavigation (rubocop#3517)
[Fixrubocop#3512] Change error message of `Lint/UnneededSplatExpansion` for array (rubocop#3526)
Fix false positive in `Lint/AssignmentInCondition` (rubocop#3520) (rubocop#3529)
Rename a mismatched filename (rubocop#3523)
Fix a broken changelog entry
[Fixrubocop#3511] Style/TernaryParentheses false positive (rubocop#3513)
Fix the release notes for 0.43
Cut 0.43.0
[Fixrubocop#3462] Don't flag single-line methods
Fix false negatives in `Rails/NotNullColumn` cop (rubocop#3508)
Remove unused doubled methods (rubocop#3509)
[Fixrubocop#3485] Make OneLineConditional cop ignore empty else (rubocop#3487)
...
Neodelf
pushed a commit
to Neodelf/rubocop
that referenced
this issue
Oct 15, 2016
I believe the following is a false positive offense in this cop when it's configured this way:
Expected behavior
My .rubocop.yml:
My ruby:
Expect no offenses
Actual behavior
$ rubocop -D Inspecting 1 file C Offenses: indent.rb:5:13: C: Style/MultilineMethodCallBraceLayout: Closing method call brace must be on the line after the last argument. ].join(' ') ^ 1 file inspected, 1 offense detected
Workaround
I can satisfy the cop by changing my ruby to this:
But I don't think it should be necessary, because the
join
method call is not multilineSteps to reproduce the problem
Using the above yaml and ruby code and running rubocop should reproduce the same behavior
RuboCop version
Include the output of
rubocop -V
:The text was updated successfully, but these errors were encountered: