Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Lint/EndInMethod cop #7817

Merged
merged 1 commit into from
Mar 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class ConfigObsoletion
'Layout/LeadingBlankLines' => 'Layout/LeadingEmptyLines',
'Layout/TrailingBlankLines' => 'Layout/TrailingEmptyLines',
'Lint/DuplicatedKey' => 'Lint/DuplicateHashKey',
'Lint/EndInMethod' => 'Style/EndBlock',
koic marked this conversation as resolved.
Show resolved Hide resolved
'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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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.