Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Style/SpaceInsideBlockBraces doesn't add an offense for multi-line blocks #3183

Closed
owst opened this issue May 31, 2016 · 0 comments
Closed

Comments

@owst
Copy link
Contributor

owst commented May 31, 2016

We use Style/BlockDelimiters Enabled: false. For the following file:

> cat foo.rb
# encoding: utf-8
# frozen_string_literal: true

[1, 2, 3].map {|x|
  puts x + 1
}

[1, 2, 3].map {|x| puts x + 1 }

Rubocop only reports the missing space for the single-line block.

Expected behavior

Rubocop reports offenses for both blocks:

Inspecting 1 file
C

Offenses:

foo.rb:4:15: C: Space between { and | missing.
[1, 2, 3].map {|x|
              ^^
foo.rb:8:15: C: Space between { and | missing.
[1, 2, 3].map {|x| puts x + 1 }
              ^^

1 file inspected, 2 offenses detected

Actual behavior

Inspecting 1 file
C

Offenses:

foo.rb:8:15: C: Space between { and | missing.
[1, 2, 3].map {|x| puts x + 1 }
              ^^

1 file inspected, 1 offense detected

Steps to reproduce the problem

Run Rubocop on the provided file with Style/BlockDelimiters disabled.

RuboCop version

Include the output of rubocop -V:

> rubocop -V
0.40.0 (using Parser 2.3.1.0, running on ruby 2.2.3 x86_64-darwin14)

@ commit 332dbaa

owst added a commit to owst/rubocop that referenced this issue Jun 15, 2016
Neodelf pushed a commit to Neodelf/rubocop that referenced this issue Oct 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant