Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix a false positive for
Layout/EmptyLinesAroundAccessModifier
This PR fixes the following infinite loop error for `Layout/EmptyLinesAroundAccessModifier` with `Layout/EmptyLinesAroundBlockBody` when using access modifier with block argument. ```console % cat example.rb FactoryBot.define do factory :model do name { 'hoge' } private { true } end end % rubocop -a --only Layout/EmptyLinesAroundAccessModifier,Layout/EmptyLinesAroundBlockBody (snip) Inspecting 1 file C Offenses: example.rb:5:5: C: [Corrected] Layout/EmptyLinesAroundAccessModifier: Keep a blank line before and after private. private { true } ^^^^^^^ example.rb:6:1: C: [Corrected] Layout/EmptyLinesAroundBlockBody: Extra empty line detected at block body end. 0 files inspected, 2 offenses detected, 2 offenses corrected Infinite loop detected in /Users/koic/src/github.com/koic/rubocop-issues/factory_bot/example.rb and caused by Layout/EmptyLinesAroundAccessModifier -> Layout/EmptyLinesAroundBlockBody ```
- Loading branch information
Showing
4 changed files
with
53 additions
and
8 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
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