Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

audit: check for cargo build only in install method #15887

Merged
merged 1 commit into from
Aug 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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