Skip to content

Commit

Permalink
rubocops/lines: simplify PyoxidizerCheck
Browse files Browse the repository at this point in the history
  • Loading branch information
carlocab committed Jul 14, 2023
1 parent e9ac36a commit 95c06f5
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions Library/Homebrew/rubocops/lines.rb
Original file line number Diff line number Diff line change
Expand Up @@ -226,24 +226,11 @@ def audit_formula(_node, _class_node, _parent_class_node, body_node)
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

Expand Down

0 comments on commit 95c06f5

Please sign in to comment.