Skip to content
Snippets Groups Projects
Commit 91a47a9e authored by Xu Cheng's avatar Xu Cheng Committed by GitHub
Browse files

LinkageChecker: simplify logic (#538)

BuiltOptions#without? already handles the option_names for dependencies.

Also check disabled recommended deps.
parent a3a6a838
No related branches found
No related tags found
No related merge requests found
......@@ -53,7 +53,8 @@ class LinkageChecker
def check_undeclared_deps
filter_out = proc do |dep|
next true if dep.build?
dep.optional? && !dep.option_names.any? { |n| formula.build.with?(n) }
next false unless dep.optional? || dep.recommended?
formula.build.without?(dep)
end
declared_deps = formula.deps.reject { |dep| filter_out.call(dep) }.map(&:name)
declared_requirement_deps = formula.requirements.reject { |req| filter_out.call(req) }.map(&:default_formula).compact
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment