-
Notifications
You must be signed in to change notification settings - Fork 214
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
SemanticBlocks collides with Style/RedundantBegin #94
Comments
tbqh the fact that |
My 2 cents: it definitely doesn’t match our org’s typical style (use braces for one liners and do/end for multi-line), but it wasn’t a big enough deal to not try out standard. But if it went away I’d be be in favor. |
Further feedback: ran into a much more complicated example in the codebase I'm converting where a value = object.some_method :arg1, arg2: :val do |something|
transform_item(something)
end into this: value = object.some_method :arg1, arg2: :val, &->(something) {
transform_item(something)
} I think this is far harder to read, and there are some on my team who wouldn't quite know how to make this conversion. If SemanticBlocks does remain in standard, I'd suggest only matching cases where the autofixer can handle the change. |
Braces for one-liners and do/end for multi-line blocks has also been a much more common standard than semantic blocks in my experience, for whatever that's worth. I understand the argument for semantic blocks, but actually using it just makes my head hurt a bit as I try to process it. Not all that readable from my perspective as being used to the other standard. 😉 |
Whenever the
Standard/SemanticBlocks
rule autofixes a block which also matches rubocop's built-inStyle/RedundantBegin
rule, the autofix results in invalid ruby:running
bundle exec standardrb --fix
on the above results inHave created a reproduction repo here.
The text was updated successfully, but these errors were encountered: