1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/actioncable/lib/action_cable/connection
Koichi ITO 5ac6ec54a6 Enable autocorrect for Lint/EndAlignment cop
### Summary

This PR changes .rubocop.yml.

Regarding the code using `if ... else ... end`, I think the coding style
that Rails expects is as follows.

```ruby
var = if cond
  a
else
  b
end
```

However, the current .rubocop.yml setting does not offense for the
following code.

```ruby
var = if cond
        a
      else
        b
      end
```

I think that the above code expects offense to be warned.
Moreover, the layout by autocorrect is unnatural.

```ruby
var = if cond
  a
      else
        b
      end
```

This PR adds a setting to .rubocop.yml to make an offense warning and
autocorrect as expected by the coding style.
And this change also fixes `case ... when ... end` together.

Also this PR itself is an example that arranges the layout using
`rubocop -a`.

### Other Information

Autocorrect of `Lint/EndAlignment` cop is `false` by default.
https://github.com/bbatsov/rubocop/blob/v0.51.0/config/default.yml#L1443

This PR changes this value to `true`.

Also this PR has changed it together as it is necessary to enable
`Layout/ElseAlignment` cop to make this behavior.
2018-01-18 17:19:13 +09:00
..
authorization.rb Use frozen string literal in actioncable/ 2017-07-23 23:30:29 +03:00
base.rb [ci skip] Prefer cookies.encrypted over signed (#30129) 2017-08-07 22:32:03 -05:00
client_socket.rb Enable autocorrect for Lint/EndAlignment cop 2018-01-18 17:19:13 +09:00
identification.rb Use frozen string literal in actioncable/ 2017-07-23 23:30:29 +03:00
internal_channel.rb Use frozen string literal in actioncable/ 2017-07-23 23:30:29 +03:00
message_buffer.rb Use frozen string literal in actioncable/ 2017-07-23 23:30:29 +03:00
stream.rb Use frozen string literal in actioncable/ 2017-07-23 23:30:29 +03:00
stream_event_loop.rb Use frozen string literal in actioncable/ 2017-07-23 23:30:29 +03:00
subscriptions.rb ActionCable: use find method when unsubscribing 2017-09-26 11:47:55 +02:00
tagged_logger_proxy.rb Use frozen string literal in actioncable/ 2017-07-23 23:30:29 +03:00
web_socket.rb Use frozen string literal in actioncable/ 2017-07-23 23:30:29 +03:00