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

Add new "Single-line do...end block" rule #922

Merged
merged 1 commit into from
Nov 5, 2023

Commits on Sep 29, 2023

  1. Add new "Single-line do...end block" rule

    Follow up rubocop/rubocop#12227 (comment)
    
    This PR adds new "Single-line `do`...`end` block" rule.
    
    Use multi-line `do`...`end` block instead of single-line `do`...`end` block.
    
    ```ruby
    # bad
    foo do |arg| bar(arg) end
    
    # good
    foo do |arg|
      bar(arg)
    end
    
    # bad
    ->(arg) do bar(arg) end
    
    # good
    ->(arg) { bar(arg) }
    ```
    koic committed Sep 29, 2023
    Configuration menu
    Copy the full SHA
    9719513 View commit details
    Browse the repository at this point in the history