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

SpaceInsideParens style checker does not recognize space after parens in some conditions #1326

Closed
joshchu opened this issue Sep 8, 2014 · 4 comments
Assignees

Comments

@joshchu
Copy link

joshchu commented Sep 8, 2014

Test case to reproduce:

  it 'reproduces issue that SpaceInsideParens does not catch space on LHS parens' do
    inspect_source(cop, ['test = ( 4 * 60 * 60)'])
    expect(cop.messages).not_to be_empty
  end

I suspect there's some sort of parse issue with SurroundingSpace but haven't had a chance to investigate/debug further

@jonas054
Copy link
Collaborator

jonas054 commented Sep 8, 2014

Thanks for reporting, I'll take a look.

@jonas054 jonas054 self-assigned this Sep 8, 2014
@joshchu
Copy link
Author

joshchu commented Sep 8, 2014

Awesome thanks @jonas054 . It might be something with order of operations and a conflict with ParenthesesAsGroupedExpression?

@jonas054
Copy link
Collaborator

jonas054 commented Sep 8, 2014

No, it's just that different kinds of left parentheses (method call, expression grouping) are represented by different tokens. We only support one currently.

bbatsov added a commit that referenced this issue Sep 8, 2014
[Fix #1326] Add other kind of parenthesis in SpaceInsideParens
@joshchu
Copy link
Author

joshchu commented Sep 9, 2014

Awesome thanks for the quick response @jonas054!

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