Merge pull request #4305 from commitay/text-dep-vendor
text_cop: require `dep ensure` to use `-vendor-only`
This commit is contained in:
commit
1433a2a83e
@ -48,6 +48,11 @@ module RuboCop
|
|||||||
find_method_with_args(body_node, :system, "go", "get") do
|
find_method_with_args(body_node, :system, "go", "get") do
|
||||||
problem "Do not use `go get`. Please ask upstream to implement Go vendoring"
|
problem "Do not use `go get`. Please ask upstream to implement Go vendoring"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
find_method_with_args(body_node, :system, "dep", "ensure") do |d|
|
||||||
|
next if parameters_passed?(d, /vendor-only/)
|
||||||
|
problem "use \"dep\", \"ensure\", \"-vendor-only\""
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -177,5 +177,19 @@ describe RuboCop::Cop::FormulaAudit::Text do
|
|||||||
end
|
end
|
||||||
RUBY
|
RUBY
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it "When dep ensure is used without `-vendor-only`" do
|
||||||
|
expect_offense(<<~RUBY)
|
||||||
|
class Foo < Formula
|
||||||
|
url "http://example.com/foo-1.0.tgz"
|
||||||
|
homepage "http://example.com"
|
||||||
|
|
||||||
|
def install
|
||||||
|
system "dep", "ensure"
|
||||||
|
^^^^^^^^^^^^^^^^^^^^^^ use \"dep\", \"ensure\", \"-vendor-only\"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
RUBY
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user