Merge pull request #2562 from DomT4/you_shall_not_pass_go_get
audit: formally ban go get usage
This commit is contained in:
commit
0c9047a2b8
@ -885,6 +885,10 @@ class FormulaAuditor
|
||||
problem "Formulae using virtualenvs do not need a `setuptools` resource."
|
||||
end
|
||||
|
||||
if text =~ /system\s+['"]go['"],\s+['"]get['"]/
|
||||
problem "Formulae should not use `go get`. If non-vendored resources are required use `go_resource`s."
|
||||
end
|
||||
|
||||
return unless text.include?('require "language/go"') && !text.include?("go_resource")
|
||||
problem "require \"language/go\" is unnecessary unless using `go_resource`s"
|
||||
end
|
||||
|
@ -430,6 +430,21 @@ describe FormulaAuditor do
|
||||
expect(fa.problems.first)
|
||||
.to match('xcodebuild should be passed an explicit "SYMROOT"')
|
||||
end
|
||||
|
||||
specify "disallow go get usage" do
|
||||
fa = formula_auditor "foo", <<-EOS.undent
|
||||
class Foo <Formula
|
||||
url "http://example.com/foo-1.0.tgz"
|
||||
|
||||
def install
|
||||
system "go", "get", "bar"
|
||||
end
|
||||
end
|
||||
EOS
|
||||
fa.audit_text
|
||||
expect(fa.problems.first)
|
||||
.to match("Formulae should not use `go get`. If non-vendored resources are required use `go_resource`s.")
|
||||
end
|
||||
end
|
||||
|
||||
describe "#audit_revision_and_version_scheme" do
|
||||
|
Loading…
x
Reference in New Issue
Block a user