Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for rubocop-rails >= 2.24.0 #20

Merged
merged 2 commits into from
May 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 12 additions & 9 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ PATH
rubocop-migration (0.5.0)
activesupport
rubocop (>= 1.34)
rubocop-rails
rubocop-rails (>= 2.24)

GEM
remote: https://rubygems.org/
Expand Down Expand Up @@ -56,37 +56,40 @@ GEM
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.12.0)
rspec-support (3.12.1)
rubocop (1.60.2)
rubocop (1.63.4)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.30.0, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.30.0)
parser (>= 3.2.1.0)
rubocop-ast (1.31.2)
parser (>= 3.3.0.4)
rubocop-capybara (2.20.0)
rubocop (~> 1.41)
rubocop-factory_bot (2.25.1)
rubocop (~> 1.41)
rubocop-performance (1.20.2)
rubocop (>= 1.48.1, < 2.0)
rubocop-ast (>= 1.30.0, < 2.0)
rubocop-rails (2.23.1)
rubocop-rails (2.24.1)
activesupport (>= 4.2.0)
rack (>= 1.1)
rubocop (>= 1.33.0, < 2.0)
rubocop-ast (>= 1.30.0, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
rubocop-rake (0.6.0)
rubocop (~> 1.0)
rubocop-rspec (2.26.1)
rubocop-rspec (2.29.2)
rubocop (~> 1.40)
rubocop-capybara (~> 2.17)
rubocop-factory_bot (~> 2.22)
rubocop-rspec_rails (~> 2.28)
rubocop-rspec_rails (2.28.3)
rubocop (~> 1.40)
ruby-progressbar (1.13.0)
ruby2_keywords (0.0.5)
sevencop (0.35.1)
Expand All @@ -97,7 +100,7 @@ GEM
unicode-display_width (2.5.0)

PLATFORMS
x86_64-linux
ruby

DEPENDENCIES
rake
Expand Down
7 changes: 6 additions & 1 deletion lib/rubocop/cop/migration/add_index_duplicate.rb
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,14 @@ def leftmost_match?(
haystack.join(',').start_with?(needle.join(','))
end

# @return [Symbol]
def parser
respond_to?(:parser_engine) ? parser_engine : :parser_whitequark
end

# @return [RuboCop::Rails::SchemaLoader::Schema, nil]
def schema
@schema ||= ::RuboCop::Rails::SchemaLoader.load(target_ruby_version)
@schema ||= ::RuboCop::Rails::SchemaLoader.load(target_ruby_version, parser)
end

# @param node [RuboCop::AST::SendNode]
Expand Down
2 changes: 1 addition & 1 deletion rubocop-migration.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ Gem::Specification.new do |spec|

spec.add_dependency 'activesupport'
spec.add_dependency 'rubocop', '>= 1.34'
spec.add_dependency 'rubocop-rails'
spec.add_dependency 'rubocop-rails', '>= 2.24'
end
Loading