Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
…nt/UnusedBlockArgument` Fixes #6956. This PR prevents auto-correct confliction of `Lint/Lambda` and `Lint/UnusedBlockArgument`. The following is the reproduction procedure. ```ruby # example.rb c = -> event do puts 'Hello world' end ``` ```console % rubocop example.rb -a --only Style/Lambda,Lint/UnusedBlockArgument ``` ## Before A reserved word `lambda` is broken. ```diff % git diff diff --git a/example.rb b/example.rb index 3445c6f..b8e24f4 100644 --- a/example.rb +++ b/example.rb @@ -1,3 +1,3 @@ -c = -> event do +c = lambda_ do |_event| puts 'Hello world' end ``` ## After It will be a valid code. ```diff % git diff diff --git a/example.rb b/example.rb index 3445c6f..9c22b37 100644 --- a/example.rb +++ b/example.rb @@ -1,3 +1,3 @@ -c = -> event do +c = lambda do |_event| puts 'Hello world' end ```
- Loading branch information
Showing
3 changed files
with
38 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters