rubocop / rubocop-capybara

Code style checking for Capybara files.
https://docs.rubocop.org/rubocop-capybara
MIT License
40 stars 8 forks source link

Correct offenses for `InternalAffairs` #29

Closed ydah closed 1 year ago

ydah commented 1 year ago

This PR correct offenses for InternalAffairs/LocationExpression and InternalAffairs/RedundantSourceRange.

Offenses:

lib/rubocop/cop/capybara/specific_actions.rb:78:52: C: [Corrected] InternalAffairs/LocationExpression: Use source_range instead.
          receiver.loc.selector.with(end_pos: node.loc.expression.end_pos)
                                                   ^^^^^^^^^^^^^^
lib/rubocop/cop/capybara/specific_finders.rb:71:51: C: [Corrected] InternalAffairs/LocationExpression: Use source_range instead.
            corrector.replace(node.first_argument.loc.expression,
                                                  ^^^^^^^^^^^^^^
lib/rubocop/cop/capybara/specific_finders.rb:120:18: C: [Corrected] InternalAffairs/LocationExpression: Use source_range instead.
            node.loc.expression.end_pos
                 ^^^^^^^^^^^^^^

33 files inspected, 3 offenses detected, 3 offenses corrected
Offenses:

lib/rubocop/cop/capybara/specific_finders.rb:71:51: C: [Correctable] InternalAffairs/RedundantSourceRange: Remove the redundant source_range.
            corrector.replace(node.first_argument.source_range,
                                                  ^^^^^^^^^^^^

33 files inspected, 1 offense detected, 1 offense autocorrectable
Error: Process completed with exit code 1.

Before submitting the PR make sure the following are checked: