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
When using the Style/SpaceBeforeBlockBraces cop if the Style/BlockDelimiters is also enabled then the Style/SpaceBeforeBlockBraces cop is not run. The code (space_before_block_braces.rb#L15-L22) implies that this is intentional saying that if you use braces for a multi-line block then you will get a warning to replace it with do...end in which case the space before the brace doesn't matter. But this is only true when using the Style/BlockDelimiters EnforcedStyle setting of line_count_based, which prohibits mutli-line blocks using braces.
But if you use the EnforcedStyle setting of either semantic or braces_for_chaining, both of which allow multi-line blocks to use braces is some cases, then you expect to get a warning from Style/SpaceBeforeBlockBraces and don't.
When using the
Style/SpaceBeforeBlockBraces
cop if theStyle/BlockDelimiters
is also enabled then theStyle/SpaceBeforeBlockBraces
cop is not run. The code (space_before_block_braces.rb#L15-L22) implies that this is intentional saying that if you use braces for a multi-line block then you will get a warning to replace it with do...end in which case the space before the brace doesn't matter. But this is only true when using theStyle/BlockDelimiters
EnforcedStyle setting ofline_count_based
, which prohibits mutli-line blocks using braces.But if you use the EnforcedStyle setting of either
semantic
orbraces_for_chaining
, both of which allow multi-line blocks to use braces is some cases, then you expect to get a warning fromStyle/SpaceBeforeBlockBraces
and don't.Steps to reproduce the problem
test.rb
test.yml
Expected behavior
Actual behavior
RuboCop version
The text was updated successfully, but these errors were encountered: