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

Fix bug with --auto-gen-config and SpaceInsideBlockBraces #1695

Merged
merged 1 commit into from
Mar 15, 2015

Conversation

meganemura
Copy link
Contributor

Auto generated config does not disable SpaceInsideBlockBraces cop for the following situation.

$ bundle exec rubocop --auto-gen-config foo.rb
foo.rb:1:6: C: Space between { and | missing.
each {|x| x }
     ^^

Offence detected, but we got the following auto-generated config.

Style/SpaceInsideBlockBraces:
  Enabled: true

So, the config does not disable it.

And, the similar issue is occured in the situation below.

  • .rubocop.yml
Style/SpaceInsideBlockBraces:
    SpaceBeforeBlockParameters: false
    EnforcedStyle: no_space
  • detection
$ bundle exec rubocop --auto-gen-config foo.rb
foo.rb:1:7: C: Space between { and | detected.
each { |x| x}
      ^
  • auto-generated config
Style/SpaceInsideBlockBraces:
  Enabled: true

This commit fixes these issues.

RuboCop: 0.29.1 (using Parser 2.2.0.3, running on ruby 2.1.4 x86_64-darwin13.0), master (ccedef2)

@meganemura meganemura force-pushed the fix-space_inside_block_braces branch 2 times, most recently from 24a8063 to d3036d4 Compare March 8, 2015 07:59
@jonas054
Copy link
Collaborator

Looks good, but please add a test that fails without the fix.

@meganemura meganemura force-pushed the fix-space_inside_block_braces branch 3 times, most recently from 8688add to faf2280 Compare March 15, 2015 09:30
@meganemura
Copy link
Contributor Author

Added failing specs ☺️

@bbatsov
Copy link
Collaborator

bbatsov commented Mar 15, 2015

And squash all commits into one. :-)

@meganemura meganemura force-pushed the fix-space_inside_block_braces branch from d7c697b to a2d709a Compare March 15, 2015 13:06
@meganemura
Copy link
Contributor Author

Squashed 🙋

bbatsov added a commit that referenced this pull request Mar 15, 2015
Fix bug with --auto-gen-config and SpaceInsideBlockBraces
@bbatsov bbatsov merged commit 2b3a209 into rubocop:master Mar 15, 2015
@bbatsov
Copy link
Collaborator

bbatsov commented Mar 15, 2015

👍 Thanks!

@meganemura meganemura deleted the fix-space_inside_block_braces branch March 18, 2015 14:16
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

Successfully merging this pull request may close these issues.

3 participants