Merge pull request #11350 from Gcenx/audit-fix-xcode-build-check
audit: Remove SYMROOT
This commit is contained in:
commit
321c165bd3
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user