text_cop: require cargo to use install instead of build
This commit is contained in:
parent
9ebcef785e
commit
3329a9f6d8
@ -53,6 +53,10 @@ module RuboCop
|
||||
next if parameters_passed?(d, /vendor-only/)
|
||||
problem "use \"dep\", \"ensure\", \"-vendor-only\""
|
||||
end
|
||||
|
||||
find_method_with_args(body_node, :system, "cargo", "build") do
|
||||
problem "use \"cargo\", \"install\", \"--root\", prefix"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@ -191,5 +191,19 @@ describe RuboCop::Cop::FormulaAudit::Text do
|
||||
end
|
||||
RUBY
|
||||
end
|
||||
|
||||
it "When cargo build is executed" do
|
||||
expect_offense(<<~RUBY)
|
||||
class Foo < Formula
|
||||
url "http://example.com/foo-1.0.tgz"
|
||||
homepage "http://example.com"
|
||||
|
||||
def install
|
||||
system "cargo", "build"
|
||||
^^^^^^^^^^^^^^^^^^^^^^^ use \"cargo\", \"install\", \"--root\", prefix
|
||||
end
|
||||
end
|
||||
RUBY
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user