Skip to content

Commit 19b68d4

Browse files
committed
Use UseProjectIndex (Rubydex) and fix offenses
1 parent 69dd434 commit 19b68d4

17 files changed

Lines changed: 17 additions & 15 deletions

.rubocop.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ plugins:
1010
AllCops:
1111
DisplayCopNames: true
1212
TargetRubyVersion: 2.7
13+
UseProjectIndex: true
1314
NewCops: disable
1415
Exclude:
1516
- 'vendor/**/*'

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ gem 'rspec', '~> 3.11'
1313
gem 'rubocop-performance', '~> 1.24'
1414
gem 'rubocop-rake', '~> 0.7'
1515
gem 'rubocop-rspec', '~> 3.5'
16+
gem 'rubydex', require: false, platforms: :ruby if RUBY_VERSION >= '3.2'
1617
gem 'simplecov', '>= 0.19'
1718
gem 'yard'
1819

lib/rubocop/cop/capybara/ambiguous_click.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ module Capybara
1717
# click_link('foo')
1818
# click_button('foo')
1919
#
20-
class AmbiguousClick < ::RuboCop::Cop::Base
20+
class AmbiguousClick < RuboCop::Cop::Base
2121
MSG = 'Use `click_link` or `click_button` instead of `%<method>s`.'
2222
RESTRICT_ON_SEND = %i[click_link_or_button click_on].freeze
2323

lib/rubocop/cop/capybara/assert_style.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ module Capybara
1212
# # good
1313
# page.find(:css, '#first').assert_matches_style(display: 'block')
1414
#
15-
class AssertStyle < ::RuboCop::Cop::Base
15+
class AssertStyle < RuboCop::Cop::Base
1616
extend AutoCorrector
1717

1818
MSG = 'Use `assert_matches_style` instead of `assert_style`.'

lib/rubocop/cop/capybara/find_all_first.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ module Capybara
2323
# # good
2424
# first('a')
2525
#
26-
class FindAllFirst < ::RuboCop::Cop::Base
26+
class FindAllFirst < RuboCop::Cop::Base
2727
extend AutoCorrector
2828
include RangeHelp
2929

lib/rubocop/cop/capybara/redundant_within_find.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ module Capybara
2626
# # ...
2727
# end
2828
#
29-
class RedundantWithinFind < ::RuboCop::Cop::Base
29+
class RedundantWithinFind < RuboCop::Cop::Base
3030
include CssSelector
3131
extend AutoCorrector
3232

lib/rubocop/cop/capybara/rspec/current_path_expectation.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ module RSpec
2727
# # bad (does not support autocorrection when `match` with a variable)
2828
# expect(current_path).to match(variable)
2929
#
30-
class CurrentPathExpectation < ::RuboCop::Cop::Base
30+
class CurrentPathExpectation < RuboCop::Cop::Base
3131
extend AutoCorrector
3232
include RangeHelp
3333

lib/rubocop/cop/capybara/rspec/have_content.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ module RSpec
1919
# expect(page).to have_text('capy')
2020
# expect(page).to have_no_text('bara')
2121
#
22-
class HaveContent < ::RuboCop::Cop::Base
22+
class HaveContent < RuboCop::Cop::Base
2323
extend AutoCorrector
2424

2525
MSG = 'Prefer `%<good>s` over `%<bad>s`.'

lib/rubocop/cop/capybara/rspec/have_selector.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ module RSpec
3333
# # good
3434
# expect(foo).to have_xpath('bar')
3535
#
36-
class HaveSelector < ::RuboCop::Cop::Base
36+
class HaveSelector < RuboCop::Cop::Base
3737
extend AutoCorrector
3838
include RangeHelp
3939

lib/rubocop/cop/capybara/rspec/match_style.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ module RSpec
2222
# # good
2323
# expect(page).to match_style(display: 'block')
2424
#
25-
class MatchStyle < ::RuboCop::Cop::Base
25+
class MatchStyle < RuboCop::Cop::Base
2626
extend AutoCorrector
2727

2828
MSG = 'Use `%<good>s` instead of `%<bad>s`.'

0 commit comments

Comments
 (0)