Skip to content

Commit

Permalink
Remove Lint/EndInMethod cop
Browse files Browse the repository at this point in the history
  • Loading branch information
tejasbubane committed Mar 23, 2020
1 parent ff197b7 commit f5ec94a
Show file tree
Hide file tree
Showing 8 changed files with 2 additions and 105 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -34,6 +34,7 @@
* [#7797](https://github.com/rubocop-hq/rubocop/pull/7797): Allow unicode-display_width dependency version 1.7.0. ([@yuritomanek][])
* [#7779](https://github.com/rubocop-hq/rubocop/issues/7779): Change `AllowComments` option of `Lint/SuppressedException` to true by default. ([@koic][])
* [#7320](https://github.com/rubocop-hq/rubocop/issues/7320): `Naming/MethodName` now flags `attr_reader/attr_writer/attr_accessor/attr`. ([@denys281][])
* [#7813](https://github.com/rubocop-hq/rubocop/issues/7813): **(Breaking)** Remove `Lint/EndInMethod` cop. ([@tejasbubane][])

## 0.80.1 (2020-02-29)

Expand Down
5 changes: 0 additions & 5 deletions config/default.yml
Expand Up @@ -1395,11 +1395,6 @@ Lint/EmptyWhen:
Enabled: true
VersionAdded: '0.45'

Lint/EndInMethod:
Description: 'END blocks should not be placed inside method definitions.'
Enabled: true
VersionAdded: '0.9'

Lint/EnsureReturn:
Description: 'Do not use return in an ensure block.'
StyleGuide: '#no-return-ensure'
Expand Down
1 change: 0 additions & 1 deletion lib/rubocop.rb
Expand Up @@ -300,7 +300,6 @@
require_relative 'rubocop/cop/lint/empty_expression'
require_relative 'rubocop/cop/lint/empty_interpolation'
require_relative 'rubocop/cop/lint/empty_when'
require_relative 'rubocop/cop/lint/end_in_method'
require_relative 'rubocop/cop/lint/ensure_return'
require_relative 'rubocop/cop/lint/erb_new_arguments'
require_relative 'rubocop/cop/lint/flip_flop'
Expand Down
1 change: 1 addition & 0 deletions lib/rubocop/config_obsoletion.rb
Expand Up @@ -19,6 +19,7 @@ class ConfigObsoletion
'Layout/LeadingBlankLines' => 'Layout/LeadingEmptyLines',
'Layout/TrailingBlankLines' => 'Layout/TrailingEmptyLines',
'Lint/DuplicatedKey' => 'Lint/DuplicateHashKey',
'Lint/EndInMethod' => 'Style/EndBlock',
'Lint/HandleExceptions' => 'Lint/SuppressedException',
'Lint/MultipleCompare' => 'Lint/MultipleComparison',
'Lint/StringConversionInInterpolation' => 'Lint/RedundantStringCoercion',
Expand Down
40 changes: 0 additions & 40 deletions lib/rubocop/cop/lint/end_in_method.rb

This file was deleted.

1 change: 0 additions & 1 deletion manual/cops.md
Expand Up @@ -195,7 +195,6 @@ In the following section you find all available cops:
* [Lint/EmptyExpression](cops_lint.md#lintemptyexpression)
* [Lint/EmptyInterpolation](cops_lint.md#lintemptyinterpolation)
* [Lint/EmptyWhen](cops_lint.md#lintemptywhen)
* [Lint/EndInMethod](cops_lint.md#lintendinmethod)
* [Lint/EnsureReturn](cops_lint.md#lintensurereturn)
* [Lint/ErbNewArguments](cops_lint.md#linterbnewarguments)
* [Lint/FlipFlop](cops_lint.md#lintflipflop)
Expand Down
31 changes: 0 additions & 31 deletions manual/cops_lint.md
Expand Up @@ -618,37 +618,6 @@ when baz then 2
end
```

## Lint/EndInMethod

Enabled by default | Safe | Supports autocorrection | VersionAdded | VersionChanged
--- | --- | --- | --- | ---
Enabled | Yes | No | 0.9 | -

This cop checks for END blocks in method definitions.

### Examples

```ruby
# bad

def some_method
END { do_something }
end
```
```ruby
# good

def some_method
at_exit { do_something }
end
```
```ruby
# good

# outside defs
END { do_something }
```

## Lint/EnsureReturn

Enabled by default | Safe | Supports autocorrection | VersionAdded | VersionChanged
Expand Down
27 changes: 0 additions & 27 deletions spec/rubocop/cop/lint/end_in_method_spec.rb

This file was deleted.

0 comments on commit f5ec94a

Please sign in to comment.