mirror of
https://github.com/gosticks/brew.git
synced 2026-10-05 23:16:55 +00:00
Merge pull request #2562 from DomT4/you_shall_not_pass_go_get
audit: formally ban go get usage
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user