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

False-positive UselessAssignment when in a slim capture block #68

Open
jhubert opened this issue Oct 1, 2017 · 3 comments
Open

False-positive UselessAssignment when in a slim capture block #68

jhubert opened this issue Oct 1, 2017 · 3 comments
Labels

Comments

@jhubert
Copy link

jhubert commented Oct 1, 2017

This is a simple recreation of the issue I bumped into with a form_for helper in rails. I'm using capture so that it's distilled down to the essence of the issue:

- url = 'https://google.com'
= capture do
  a href=url = 'Google'

Running slim-lint on this gives me:

test.html.slim:2 [W] RuboCop: Useless assignment to variable - `url`.
@sds sds added the bug label Nov 16, 2017
@seliverstov-maxim
Copy link

seliverstov-maxim commented May 7, 2019

up

@yjukaku
Copy link
Contributor

yjukaku commented Aug 5, 2021

I believe this happens with any method that takes a block, not just capture.

@jclusso
Copy link
Contributor

jclusso commented Feb 26, 2024

Any idea on how to fix this. Happy to open a PR with some guidance.

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

5 participants