Skip to content

Commit

Permalink
Merge pull request #8 from netlify/update-dependencies
Browse files Browse the repository at this point in the history
Update rubocop dependency to < 2.0
  • Loading branch information
kitop committed Mar 29, 2021
2 parents 7983cf3 + 2df866c commit df16396
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
1 change: 0 additions & 1 deletion lib/rubocop/cop/netlify/invalid_model_assignment.rb
Expand Up @@ -13,7 +13,6 @@ module Netlify
# form.email = "bettse@netlify.com"
class InvalidModelAssignment < Cop
MSG = "Assigning to `attributes` will not update record"
RESTRICT_ON_SEND = [:attributes].freeze

def_node_matcher :assign_attributes?, <<~PATTERN
(send (send (...) :attributes) :[]= _ _)
Expand Down
2 changes: 1 addition & 1 deletion rubocop-netlify.gemspec
Expand Up @@ -14,7 +14,7 @@ Gem::Specification.new do |spec|
spec.license = "MIT"
spec.required_ruby_version = Gem::Requirement.new(">= 2.5.0")

spec.add_dependency "rubocop", "~> 0.72", "< 0.83"
spec.add_dependency "rubocop", "~> 0.72", "< 2.0"
spec.add_development_dependency "minitest", "~> 5.10"

# Specify which files should be added to the gem when it is released.
Expand Down
9 changes: 4 additions & 5 deletions test/assertion_helper.rb
Expand Up @@ -3,7 +3,6 @@
# Copied and adapted from:
# https://github.com/rubocop-hq/rubocop-minitest/blob/v0.8.1/test/assertion_helper.rb
#
#
# ===========
#
#
Expand Down Expand Up @@ -70,10 +69,10 @@ def inspect_source(source, cop, file = nil)
end

def investigate(cop, processed_source)
forces = RuboCop::Cop::Force.all.each_with_object([]) do |klass, instances|
next unless cop.join_force?(klass)

instances << klass.new([cop])
needed = Hash.new { |h, k| h[k] = [] }
Array(cop.class.joining_forces).each { |force| needed[force] << cop }
forces = needed.map do |force_class, joining_cops|
force_class.new(joining_cops)
end

commissioner = RuboCop::Cop::Commissioner.new([cop], forces, raise_error: true)
Expand Down

0 comments on commit df16396

Please sign in to comment.