rubocop / rubocop-ast

RuboCop's AST extensions and NodePattern functionality
https://docs.rubocop.org/rubocop-ast
MIT License
104 stars 52 forks source link

Fix RuboCop offense #321

Closed Earlopain closed 6 days ago

Earlopain commented 6 days ago

From https://github.com/rubocop/rubocop/pull/13312, probably

$ bundle exec rubocop
Inspecting 165 files
..............................W......................................................................................................................................

Offenses:

lib/rubocop/ast/node/if_node.rb:105:45: W: [Correctable] Lint/SafeNavigationConsistency: Use . instead of unnecessary &..
        else_branch&.if_type? && else_branch&.elsif?
                                            ^^

165 files inspected, 1 offense detected, 1 offense autocorrectable