Merge pull request #15679 from carlocab/pyoxidizer-check

rubocops/lines: simplify PyoxidizerCheck
This commit is contained in:
Mike McQuaid 2023-07-17 19:20:16 +01:00 committed by GitHub
commit e48898d5ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -226,24 +226,11 @@ module RuboCop
class PyoxidizerCheck < FormulaCop
def audit_formula(_node, _class_node, _parent_class_node, body_node)
return if body_node.nil?
# Disallow use of PyOxidizer as a dependency in core
return if formula_tap != "homebrew-core"
return unless depends_on?("pyoxidizer")
find_method_with_args(body_node, :depends_on, "pyoxidizer") do
problem "Formulae in homebrew/core should not use '#{@offensive_node.source}'."
end
[
:build,
[:build],
[:build, :test],
[:test, :build],
].each do |type|
find_method_with_args(body_node, :depends_on, "pyoxidizer" => type) do
problem "Formulae in homebrew/core should not use '#{@offensive_node.source}'."
end
end
problem "Formulae in homebrew/core should not use '#{@offensive_node.source}'."
end
end