Find file History
Latest commit 5ac6ec5 Jan 17, 2018 @koic koic 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.
Permalink
..
Failed to load latest commit information.
array Update incorrect backtick usage in RDoc to teletype Nov 22, 2017
big_decimal [Active Support] `rubocop -a --only Layout/EmptyLineAfterMagicComment` Jul 11, 2017
class [Active Support] require_relative => require Oct 21, 2017
date [Active Support] require_relative => require Oct 21, 2017
date_and_time Refactor Date/Time next_occurring and prev_occurring Nov 28, 2017
date_time Fix "the the " [ci skip] Jan 10, 2018
digest Update links to use https instead of http [ci skip] Aug 22, 2017
file [Active Support] `rubocop -a --only Layout/EmptyLineAfterMagicComment` Jul 11, 2017
hash Enable autocorrect for `Lint/EndAlignment` cop Jan 18, 2018
integer Simplify API documentation of methods that return a Duration Oct 24, 2017
kernel [Active Support] require_relative => require Oct 21, 2017
module Remove undefined `track_deletion` callback [ci skip] Jan 2, 2018
numeric Enable `Style/RedundantReturn` rubocop rule, and fixed a couple more Oct 31, 2017
object Merge pull request #31049 from gwincr11/cg-blank Jan 4, 2018
range Allow `Range#include?` on TWZ ranges Nov 8, 2017
string Mention about Ruby 2.4 Unicode case mappings in `mb_chars` example [c… Nov 29, 2017
time [Active Support] require_relative => require Oct 21, 2017
array.rb [Active Support] require_relative => require Oct 21, 2017
benchmark.rb [Active Support] `rubocop -a --only Layout/EmptyLineAfterMagicComment` Jul 11, 2017
big_decimal.rb [Active Support] require_relative => require Oct 21, 2017
class.rb [Active Support] require_relative => require Oct 21, 2017
date.rb [Active Support] require_relative => require Oct 21, 2017
date_time.rb [Active Support] require_relative => require Oct 21, 2017
enumerable.rb [Active Support] `rubocop -a --only Layout/EmptyLineAfterMagicComment` Jul 11, 2017
file.rb [Active Support] require_relative => require Oct 21, 2017
hash.rb [Active Support] require_relative => require Oct 21, 2017
integer.rb [Active Support] require_relative => require Oct 21, 2017
kernel.rb [Active Support] require_relative => require Oct 21, 2017
load_error.rb Remove unused `LoadError::REGEXPS` constant Aug 3, 2017
marshal.rb [Active Support] `rubocop -a --only Layout/EmptyLineAfterMagicComment` Jul 11, 2017
module.rb [Active Support] require_relative => require Oct 21, 2017
name_error.rb Merge pull request #29685 from ayanko/fix-slow-name-error-missing-name Jan 9, 2018
numeric.rb [Active Support] require_relative => require Oct 21, 2017
object.rb [Active Support] require_relative => require Oct 21, 2017
range.rb Allow `Range#include?` on TWZ ranges Nov 8, 2017
regexp.rb [Active Support] `rubocop -a --only Layout/EmptyLineAfterMagicComment` Jul 11, 2017
securerandom.rb [Active Support] `rubocop -a --only Layout/EmptyLineAfterMagicComment` Jul 11, 2017
string.rb [Active Support] require_relative => require Oct 21, 2017
time.rb [Active Support] require_relative => require Oct 21, 2017
uri.rb Clarify intentions around method redefinitions Sep 1, 2017