Merge pull request #12493 from carlocab/pyoxidizer
rubocops/lines: disallow `pyoxidizer` as a build/runtime dependency
This commit is contained in:
commit
8f858331f8
@ -211,6 +211,32 @@ module RuboCop
|
||||
end
|
||||
end
|
||||
|
||||
# This cop makes sure that formulae do not depend on `pyoxidizer` at build-time
|
||||
# or run-time.
|
||||
#
|
||||
# @api private
|
||||
class PyoxidizerCheck < FormulaCop
|
||||
def audit_formula(_node, _class_node, _parent_class_node, body_node)
|
||||
# Disallow use of PyOxidizer as a dependency in core
|
||||
return unless formula_tap == "homebrew-core"
|
||||
|
||||
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
|
||||
end
|
||||
end
|
||||
|
||||
# This cop makes sure that the safe versions of `popen_*` calls are used.
|
||||
#
|
||||
# @api private
|
||||
|
Loading…
x
Reference in New Issue
Block a user