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

Layout/SpaceInsideReferenceBrackets has false negative, when references nested. #5914

Closed
takumiabe opened this issue May 25, 2018 · 2 comments

Comments

@takumiabe
Copy link

Layout/SpaceInsideReferenceBrackets doesn't detect the offence, with nested blackets accessor.

Expected behavior

It's offence.

Actual behavior

Offence not detected.

Steps to reproduce the problem

test.yml

Layout/SpaceInsideReferenceBrackets:
  Enabled: true
  EnforcedStyle: no_space

test.rb

record[ options[:attribute] ]

and

$ rubocop -c test.yml test.rb --only Layout/SpaceInsideReferenceBrackets
Inspecting 1 file
.

1 file inspected, no offenses detected

RuboCop version

$ bin/rubocop -V
0.56.0 (using Parser 2.5.1.0, running on ruby 2.5.1 x86_64-darwin17)
koic added a commit to koic/rubocop that referenced this issue May 28, 2018
…eBrackets`

Fixes rubocop#5914.

This PR makes `Layout/SpaceInsideReferenceBrackets` aware of `no_space`
when using nested refefence brackets.
@koic
Copy link
Member

koic commented May 28, 2018

Thanks for the feedback and concrete step to reproduction. I confirmed this reproduction and opened a PR #5923. Thank you!

bbatsov pushed a commit that referenced this issue May 29, 2018
Fixes #5914.

This PR makes `Layout/SpaceInsideReferenceBrackets` aware of `no_space`
when using nested refefence brackets.
@takumiabe
Copy link
Author

@koic
Thank you quick response and fix!
I'm happy :)

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

2 participants