Merge pull request #12823 from carlocab/setuptools-audit

rubocops/text: remove `setuptools` audit
This commit is contained in:
Carlo Cabrera 2022-02-01 16:57:57 +08:00 committed by GitHub
commit f05e57f414
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 0 additions and 26 deletions

View File

@ -35,13 +35,6 @@ module RuboCop
problem "Formulae in homebrew/core should use OpenBLAS as the default serial linear algebra library."
end
if method_called_ever?(body_node, :virtualenv_create) ||
method_called_ever?(body_node, :virtualenv_install_with_resources)
find_method_with_args(body_node, :resource, "setuptools") do
problem "Formulae using virtualenvs do not need a `setuptools` resource."
end
end
unless method_called_ever?(body_node, :go_resource)
# processed_source.ast is passed instead of body_node because `require` would be outside body_node
find_method_with_args(processed_source.ast, :require, "language/go") do

View File

@ -144,25 +144,6 @@ describe RuboCop::Cop::FormulaAudit::Text do
RUBY
end
it "reports an offense if formula uses virtualenv and also `setuptools` resource" do
expect_offense(<<~RUBY)
class Foo < Formula
url "https://brew.sh/foo-1.0.tgz"
homepage "https://brew.sh"
resource "setuptools" do
^^^^^^^^^^^^^^^^^^^^^ Formulae using virtualenvs do not need a `setuptools` resource.
url "https://foo.com/foo.tar.gz"
sha256 "db0904a28253cfe53e7dedc765c71596f3c53bb8a866ae50123320ec1a7b73fd"
end
def install
virtualenv_create(libexec)
end
end
RUBY
end
it "reports an offense if `Formula.factory(name)` is present" do
expect_offense(<<~RUBY)
class Foo < Formula