1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/actionpack/lib/action_dispatch/http
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
..
cache.rb Introduced ActiveSupport::Digest that allows to specify hash function implementation 2017-12-12 11:23:54 -08:00
content_security_policy.rb Add missing require 2017-12-05 18:16:41 +09:00
filter_parameters.rb Merge pull request #31078 from aeroastro/feature/fix-typo 2017-11-09 00:53:39 -05:00
filter_redirect.rb Use frozen string literal in actionpack/ 2017-07-29 14:02:40 +03:00
headers.rb Use frozen string literal in actionpack/ 2017-07-29 14:02:40 +03:00
mime_negotiation.rb Remove mention of X-Post-Data-Format header [ci skip] 2017-10-28 00:39:00 +01:00
mime_type.rb [Action Pack] require => require_relative 2017-10-21 22:48:28 +09:00
mime_types.rb Fix typo in mime type registering 2017-11-29 02:37:39 -05:00
parameter_filter.rb Use frozen string literal in actionpack/ 2017-07-29 14:02:40 +03:00
parameters.rb Remove deprecated ActionController::ParamsParser::ParseError 2017-10-23 12:50:45 -04:00
rack_cache.rb Use frozen string literal in actionpack/ 2017-07-29 14:02:40 +03:00
request.rb Add DSL for configuring Content-Security-Policy header 2017-11-27 05:59:26 +00:00
response.rb [Action Pack] require => require_relative 2017-10-21 22:48:28 +09:00
upload.rb Use frozen string literal in actionpack/ 2017-07-29 14:02:40 +03:00
url.rb Enable autocorrect for Lint/EndAlignment cop 2018-01-18 17:19:13 +09:00