Skip to content

Commit

Permalink
Use version class for package manager to check satisfaction when clos…
Browse files Browse the repository at this point in the history
…ing PRs (#472)

Co-authored-by: Maxwell Mburu <maxwell@Maxwells-MacBook-Pro.local>
  • Loading branch information
mburumaxwell and Maxwell Mburu authored Jan 16, 2023
1 parent 6c28bd6 commit efc465e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion script/update-script.rb
Original file line number Diff line number Diff line change
Expand Up @@ -814,9 +814,11 @@ def peer_dependency_should_update_instead?(dependency_name, updated_deps, files,

# Check if the version has since been ignored, it so we do not keep
requirement_class = Dependabot::Utils.requirement_class_for_package_manager(dep.package_manager)
version_class = Dependabot::Utils.version_class_for_package_manager(dep.package_manager) # necessary for npm
next unless version_class.correct?(dep.version) # git_submodules don't work here
ignore_reqs = ignored_versions_for(dep)
.flat_map { |req| requirement_class.requirements_array(req) }
if ignore_reqs.any? { |req| req.satisfied_by?(dep.version) }
if ignore_reqs.any? { |req| req.satisfied_by?(version_class.new(dep.version)) }
puts "Update for #{dep.name} #{dep.version} is no longer required."
next
end
Expand Down

0 comments on commit efc465e

Please sign in to comment.