Skip to content

Commit bab09ee

Browse files
mctofuDavid Rodriguez
and
David Rodriguez
committed
Improve readability of information_only dependency check
Co-authored-by: David Rodriguez <[email protected]>
1 parent 6fdb1e0 commit bab09ee

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

common/lib/dependabot/dependency.rb

+7
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,13 @@ def all_versions
115115
all_versions.filter_map(&:version)
116116
end
117117

118+
# This dependency is being indirectly updated by an update to another
119+
# dependency. We don't need to try and update it ourselves but want to
120+
# surface it to the user in the PR.
121+
def informational_only?
122+
metadata[:information_only]
123+
end
124+
118125
def ==(other)
119126
other.instance_of?(self.class) && to_h == other.to_h
120127
end

updater/lib/dependabot/updater.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -736,7 +736,7 @@ def generate_dependency_files_for(updated_dependencies)
736736
# Ignore dependencies that are tagged as information_only. These will be
737737
# updated indirectly as a result of a parent dependency update and are
738738
# only included here to be included in the PR info.
739-
deps_to_update = updated_dependencies.reject { |d| d.metadata[:information_only] }
739+
deps_to_update = updated_dependencies.reject(&:informational_only?)
740740
updater = file_updater_for(deps_to_update)
741741
updater.updated_dependency_files
742742
end

0 commit comments

Comments
 (0)