Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refine offense range for
Lint/SafeNavigationWithEmpty
This PR refines offense range for `Lint/SafeNavigationWithEmpty`. The following is an example. ```ruby return unless foo&.empty? ``` ## Before ```console % bundle exec rubocop example.rb --only Lint/SafeNavigationWithEmpty (snip) Offenses: example.rb:1:1: W: Lint/SafeNavigationWithEmpty: Avoid calling empty? with the safe navigation operator in conditionals. return unless foo&.empty? ^^^^^^^^^^^^^^^^^^^^^^^^^ 1 file inspected, 1 offense detected ``` ## After ```console % bundle exec rubocop example.rb --only Lint/SafeNavigationWithEmpty (snip) Offenses: example.rb:1:15: W: Lint/SafeNavigationWithEmpty: Avoid calling empty? with the safe navigation operator in conditionals. return unless foo&.empty? ^^^^^^^^^^^ 1 file inspected, 1 offense detected ```
- Loading branch information