-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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/SpaceBeforeBrackets: a space is incorrectly added to strip_whitespace % w[name email]
#9290
Labels
Comments
Another example that should not generate a warning: link_to [@site, person] do
content_tag(:span, person.email)
end |
Actually, this fails with any method that accepts an array as params, if not using parenthesis (which is quite common in DSLs) |
8 tasks
koic
added a commit
to koic/rubocop
that referenced
this issue
Dec 27, 2020
Fixes rubocop#9290. This PR fixes a false positive for `Layout/SpaceBeforeBrackets` when using array literal argument for method call. If receiver is a method call, it is difficult to prevent false positives. Therefore, This PR change behaviour to detect only when receiver is a variable. As a result, safe detection is possible.
bbatsov
pushed a commit
that referenced
this issue
Dec 27, 2020
Fixes #9290. This PR fixes a false positive for `Layout/SpaceBeforeBrackets` when using array literal argument for method call. If receiver is a method call, it is difficult to prevent false positives. Therefore, This PR change behaviour to detect only when receiver is a variable. As a result, safe detection is possible.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Expected behavior
Does noting to
before_validation { to_downcase %w[email] }
Actual behavior
Layout/SpaceBeforeBrackets: a space is incorrectly added to
before_validation { to_downcase %w[email] }
=>before_validation { to_downcase % w[email] }
Steps to reproduce the problem
Add
before_validation { to_downcase %w[email] }
to model fileRuboCop version
The text was updated successfully, but these errors were encountered: