Merge pull request #11350 from Gcenx/audit-fix-xcode-build-check

audit: Remove SYMROOT
This commit is contained in:
Mike McQuaid 2021-05-13 13:50:40 +01:00 committed by GitHub
commit 321c165bd3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 0 additions and 32 deletions

View File

@ -53,12 +53,6 @@ module RuboCop
problem "\"Formula.factory(name)\" is deprecated in favor of \"Formula[name]\""
end
find_every_method_call_by_name(body_node, :xcodebuild).each do |m|
next if parameters_passed?(m, /SYMROOT=/)
problem 'xcodebuild should be passed an explicit "SYMROOT"'
end
find_method_with_args(body_node, :system, "xcodebuild") do
problem %q(use "xcodebuild *args" instead of "system 'xcodebuild', *args")
end

View File

@ -71,32 +71,6 @@ describe RuboCop::Cop::FormulaAudit::Text do
RUBY
end
it "reports an offense if xcodebuild is called without SYMROOT" do
expect_offense(<<~RUBY)
class Foo < Formula
url "https://brew.sh/foo-1.0.tgz"
homepage "https://brew.sh"
def install
xcodebuild "-project", "meow.xcodeproject"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ xcodebuild should be passed an explicit \"SYMROOT\"
end
end
RUBY
expect_offense(<<~RUBY)
class Foo < Formula
url "https://brew.sh/foo-1.0.tgz"
homepage "https://brew.sh"
def install
xcodebuild
^^^^^^^^^^ xcodebuild should be passed an explicit \"SYMROOT\"
end
end
RUBY
end
it "reports an offense if `go get` is executed" do
expect_offense(<<~RUBY)
class Foo < Formula