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

RuboCop: useless assignment bug? #39

Closed
lencioni opened this issue Oct 9, 2014 · 5 comments
Closed

RuboCop: useless assignment bug? #39

lencioni opened this issue Oct 9, 2014 · 5 comments
Labels

Comments

@lencioni
Copy link
Contributor

lencioni commented Oct 9, 2014

I'm not sure if this is a bug in haml-lint or RuboCop, but haml-lint 0.7.0 and rubocop 0.26.1, I get a problem on line 1 of the following haml file:

- things = [1, 2]
- things.each do |thing|
  = thing

RuboCop: Useless assignment to variable = things

@sds sds added the invalid label Nov 11, 2014
@sds
Copy link
Owner

sds commented Nov 11, 2014

Hey @lencioni,

I'm unable to reproduce this locally. My guess is an unsaved vim buffer?

Let me know if you still are able to reproduce and we can investigate further.

@sds sds closed this as completed Nov 11, 2014
@lencioni
Copy link
Contributor Author

I am able to reproduce this consistently. I did just now by creating a new file with the contents I specified above and ran haml-lint on just that file via the command line.

haml-lint 0.7.0, rubocop 0.27.1.

When I run haml-lint --version, I also get these warnings:

warning: parser/current is loading parser/ruby21, which recognizes
warning: 2.1.4-compliant syntax, but you are running 2.1.2.

I can show you at the office tomorrow if you are interested.

@sds
Copy link
Owner

sds commented Nov 11, 2014

Interesting. I can't reproduce this on CentOS or Mac OS X Yosemite after uninstalling/installing haml-lint 0.7.0 and rubocop 0.27.1 for Ruby 2.1.2 (I do get the parser warning, but not the RuboCop error). We'll have to have a look tomorrow I guess.

@sds
Copy link
Owner

sds commented Nov 11, 2014

This seems to have something to do with your system running the latest version of the haml gem (4.1.0.beta.1 at time of writing).

This version likely mucked around with the parse tree representation. Will have a look when I can.

@sds
Copy link
Owner

sds commented Nov 21, 2014

Fixed in b504293 and released in 0.8.0

@sds sds closed this as completed Nov 21, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants