Skip to content

Commit

Permalink
Merge pull request #15887 from Homebrew/cargo-build-audit
Browse files Browse the repository at this point in the history
audit: check for cargo build only in install method
  • Loading branch information
MikeMcQuaid authored Aug 18, 2023
2 parents 5d4d674 + b4366b6 commit 7a974f3
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Library/Homebrew/rubocops/text.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ def audit_formula(node, _class_node, _parent_class_node, body_node)
find_method_with_args(method_node, :system, "go", "get") do
problem "Do not use `go get`. Please ask upstream to implement Go vendoring"
end

find_method_with_args(method_node, :system, "cargo", "build") do |m|
next if parameters_passed?(m, [/--lib/])

problem "use \"cargo\", \"install\", *std_cargo_args"
end
end

find_method_with_args(body_node, :system, "dep", "ensure") do |d|
Expand All @@ -65,12 +71,6 @@ def audit_formula(node, _class_node, _parent_class_node, body_node)
problem "use \"dep\", \"ensure\", \"-vendor-only\""
end

find_method_with_args(body_node, :system, "cargo", "build") do |m|
next if parameters_passed?(m, [/--lib/])

problem "use \"cargo\", \"install\", *std_cargo_args"
end

find_every_method_call_by_name(body_node, :system).each do |m|
next unless parameters_passed?(m, [/make && make/])

Expand Down

0 comments on commit 7a974f3

Please sign in to comment.