aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMike McQuaid2017-04-30 13:32:22 +0100
committerGitHub2017-04-30 13:32:22 +0100
commit0c9047a2b81eaa58ccffa286a08df214a05f88ef (patch)
tree7efae1bbf35900a318265d8a1e9410234df37ac7 /Library
parent59f78361c98a002ddb807a223ecc50d6199d9f9a (diff)
parented1ae19aee53c3631a5d4a20e1f4e0a903511cca (diff)
downloadbrew-0c9047a2b81eaa58ccffa286a08df214a05f88ef.tar.bz2
Merge pull request #2562 from DomT4/you_shall_not_pass_go_get
audit: formally ban go get usage
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/dev-cmd/audit.rb4
-rw-r--r--Library/Homebrew/test/dev-cmd/audit_spec.rb15
2 files changed, 19 insertions, 0 deletions
diff --git a/Library/Homebrew/dev-cmd/audit.rb b/Library/Homebrew/dev-cmd/audit.rb
index b69fbcfb7..782405207 100644
--- a/Library/Homebrew/dev-cmd/audit.rb
+++ b/Library/Homebrew/dev-cmd/audit.rb
@@ -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
diff --git a/Library/Homebrew/test/dev-cmd/audit_spec.rb b/Library/Homebrew/test/dev-cmd/audit_spec.rb
index 9afb7954a..771e1ee79 100644
--- a/Library/Homebrew/test/dev-cmd/audit_spec.rb
+++ b/Library/Homebrew/test/dev-cmd/audit_spec.rb
@@ -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