Skip to content

Commit

Permalink
[Fixes #8321] Enable auto correction for Layout/{Def}EndAlignment, Li…
Browse files Browse the repository at this point in the history
…nt/EmptyEnsure
  • Loading branch information
marcandre authored and mergify[bot] committed Aug 26, 2020
1 parent 220e6b6 commit 414b6e5
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 23 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -29,6 +29,7 @@
* [#8158](https://github.com/rubocop-hq/rubocop/issues/8158): Fix `Style/MultilineWhenThen` cop to correctly handle cases with multiline body. ([@dsavochkin][])
* [#7705](https://github.com/rubocop-hq/rubocop/issues/7705): Fix `Style/OneLineConditional` cop to handle if/then/elsif/then/else/end cases. Add `AlwaysCorrectToMultiline` config option to this cop to always convert offenses to the multi-line form (false by default). ([@Lykos][], [@dsavochkin][])
* [#8590](https://github.com/rubocop-hq/rubocop/issues/8590): Fix an error when auto-correcting encoding mismatch file. ([@koic][])
* [#8321](https://github.com/rubocop-hq/rubocop/issues/8321): Enable auto-correction for `Layout/{Def}EndAlignment`, `Lint/EmptyEnsure`. ([@marcandre][])

### Changes

Expand Down
3 changes: 0 additions & 3 deletions config/default.yml
Expand Up @@ -399,7 +399,6 @@ Layout/DefEndAlignment:
SupportedStylesAlignWith:
- start_of_line
- def
AutoCorrect: false
Severity: warning

Layout/DotPosition:
Expand Down Expand Up @@ -555,7 +554,6 @@ Layout/EndAlignment:
- keyword
- variable
- start_of_line
AutoCorrect: false
Severity: warning

Layout/EndOfLine:
Expand Down Expand Up @@ -1458,7 +1456,6 @@ Lint/EmptyEnsure:
Enabled: true
VersionAdded: '0.10'
VersionChanged: '0.48'
AutoCorrect: false

Lint/EmptyExpression:
Description: 'Checks for empty expressions.'
Expand Down
8 changes: 0 additions & 8 deletions docs/modules/ROOT/pages/cops_layout.adoc
Expand Up @@ -951,10 +951,6 @@ private def foo
| `start_of_line`
| `start_of_line`, `def`

| AutoCorrect
| `false`
| Boolean

| Severity
| `warning`
| String
Expand Down Expand Up @@ -2074,10 +2070,6 @@ variable =
| `keyword`
| `keyword`, `variable`, `start_of_line`

| AutoCorrect
| `false`
| Boolean

| Severity
| `warning`
| String
Expand Down
10 changes: 0 additions & 10 deletions docs/modules/ROOT/pages/cops_lint.adoc
Expand Up @@ -1063,16 +1063,6 @@ ensure
end
----

=== Configurable attributes

|===
| Name | Default value | Configurable values

| AutoCorrect
| `false`
| Boolean
|===

== Lint/EmptyExpression

|===
Expand Down
4 changes: 2 additions & 2 deletions spec/rubocop/cli/cli_autocorrect_spec.rb
Expand Up @@ -745,7 +745,7 @@ def func
bar
rescue StandardError
baz
end
end
def func
x; y; rescue StandardError; z
Expand Down Expand Up @@ -1111,7 +1111,7 @@ module A module B
module A
module B
end end
end end
RUBY
uncorrected = $stdout.string.split($RS).select do |line|
line.include?('example.rb:') && !line.include?('[Corrected]')
Expand Down

0 comments on commit 414b6e5

Please sign in to comment.