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

Style/IfUnlessModifier bad length calculation #8283

Closed
marcandre opened this issue Jul 9, 2020 · 0 comments · Fixed by #8435
Closed

Style/IfUnlessModifier bad length calculation #8283

marcandre opened this issue Jul 9, 2020 · 0 comments · Fixed by #8435

Comments

@marcandre
Copy link
Contributor

marcandre commented Jul 9, 2020

Unless I'm mistaken, Style/IfUnlessModifier doesn't take into account the comment in the length, to check if the modifier form will fit or not.

if foo # this comment's length is not taken into account
  bar
end
# corrected to
bar if foo # this comment's length is not taken into account

Ideally the code to calculate this should use the exact same method that actually computes the replacement...

See also #8282 and #8281

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant