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 Style/RedundantParentheses when wrap lambda #12514

Closed
javierav opened this issue Dec 5, 2023 · 1 comment
Closed

False Style/RedundantParentheses when wrap lambda #12514

javierav opened this issue Dec 5, 2023 · 1 comment

Comments

@javierav
Copy link
Contributor

javierav commented Dec 5, 2023

When run rubocop over this:

scope :with_email_confirmed, (lambda do |email_confirmed|
 # ...
end)
 C: [Correctable] Style/RedundantParentheses: Don't use parentheses around an expression.

The parentheses are necessary, otherwise the code block would be passed directly to the scope function as a block instead of to the lambda.

RuboCop version

$ [bundle exec] rubocop -V
1.58.0 (using Parser 3.2.2.4, rubocop-ast 1.30.0, running on ruby 3.2.1) [arm64-darwin21]
@ydakuka
Copy link

ydakuka commented Dec 5, 2023

This was solved here: #12505

@koic koic added the duplicate label Dec 5, 2023
@koic koic closed this as completed Dec 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants