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
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
..
channel Use frozen string literal in actioncable/ 2017-07-23 23:30:29 +03:00
connection Enable autocorrect for Lint/EndAlignment cop 2018-01-18 17:19:13 +09:00
helpers Use frozen string literal in actioncable/ 2017-07-23 23:30:29 +03:00
server Distinguish missing adapter gems from load errors within the adapter 2017-10-08 14:47:51 -07:00
subscription_adapter PostgreSQL: Allow pg-1.0 gem to be used with ActiveRecord 2018-01-10 21:55:43 +01:00
channel.rb Use frozen string literal in actioncable/ 2017-07-23 23:30:29 +03:00
connection.rb Use frozen string literal in actioncable/ 2017-07-23 23:30:29 +03:00
engine.rb [Action Cable] require_relative => require 2017-10-21 22:48:29 +09:00
gem_version.rb Preparing for 5.2.0.beta2 release 2017-11-28 14:41:02 -05:00
remote_connections.rb Clarify intentions around method redefinitions 2017-09-01 14:27:13 +09:30
server.rb Use frozen string literal in actioncable/ 2017-07-23 23:30:29 +03:00
subscription_adapter.rb Use frozen string literal in actioncable/ 2017-07-23 23:30:29 +03:00
version.rb Use frozen string literal in actioncable/ 2017-07-23 23:30:29 +03:00