Merge pull request #12819 from rolandcrosby/rubocop-cargo-lib
Formula: Allow `cargo build` when building libraries
This commit is contained in:
commit
7a31b3bebf
@ -70,7 +70,9 @@ module RuboCop
|
|||||||
problem "use \"dep\", \"ensure\", \"-vendor-only\""
|
problem "use \"dep\", \"ensure\", \"-vendor-only\""
|
||||||
end
|
end
|
||||||
|
|
||||||
find_method_with_args(body_node, :system, "cargo", "build") do
|
find_method_with_args(body_node, :system, "cargo", "build") do |m|
|
||||||
|
next if parameters_passed?(m, /--lib/)
|
||||||
|
|
||||||
problem "use \"cargo\", \"install\", *std_cargo_args"
|
problem "use \"cargo\", \"install\", *std_cargo_args"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -205,6 +205,19 @@ describe RuboCop::Cop::FormulaAudit::Text do
|
|||||||
RUBY
|
RUBY
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it "doesn't reports an offense if `cargo build` is executed with --lib" do
|
||||||
|
expect_no_offenses(<<~RUBY)
|
||||||
|
class Foo < Formula
|
||||||
|
url "https://brew.sh/foo-1.0.tgz"
|
||||||
|
homepage "https://brew.sh"
|
||||||
|
|
||||||
|
def install
|
||||||
|
system "cargo", "build", "--lib"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
RUBY
|
||||||
|
end
|
||||||
|
|
||||||
it "reports an offense if `make` calls are not separated" do
|
it "reports an offense if `make` calls are not separated" do
|
||||||
expect_offense(<<~RUBY)
|
expect_offense(<<~RUBY)
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
|
Loading…
x
Reference in New Issue
Block a user