rubocop / rubocop-capybara

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

Enable cop for pending rubocop-performance #103

Closed ydah closed 8 months ago

ydah commented 8 months ago

This PR enable cop for pending rubocop-performance and correct some offense.

❯ bundle exec rubocop
Inspecting 44 files
...................C.....................C..

Offenses:

lib/rubocop/cop/capybara/specific_finders.rb:109:22: C: [Correctable] Performance/MapCompact: Use filter_map instead.
          attrs.each.map do |key, value| ...
                     ^^^^^^^^^^^^^^^^^^^
spec/spec_helper.rb:17:9: C: Performance/MethodObjectAsBlock: Use block explicitly instead of block-passing a method object.
  .each(&method(:require))
        ^^^^^^^^^^^^^^^^^

44 files inspected, 2 offenses detected, 1 offense autocorrectable

Before submitting the PR make sure the following are checked: