Merge pull request #6968 from MikeMcQuaid/make-check-audit-whitelist

rubocop/lines: add whitelist.
This commit is contained in:
Mike McQuaid 2020-01-29 12:33:53 +00:00 committed by GitHub
commit f8a4dd9fc5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 2 deletions

View File

@ -424,6 +424,25 @@ module RuboCop
# Avoid build-time checks in homebrew/core
find_every_method_call_by_name(body_node, :system).each do |method|
next if @formula_name.start_with?("lib")
next if %w[
beecrypt
ccrypt
git
gmp
gnupg
gnupg@1.4
google-sparsehash
jemalloc
jpeg-turbo
mpfr
open-mpi
openssl@1.1
pcre
wolfssl
xz
].include?(@formula_name)
params = parameters(method)
next unless node_equals?(params[0], "make")
@ -431,7 +450,8 @@ module RuboCop
next unless regex_match_group(arg, /^(checks?|tests?)$/)
offending_node(method)
problem "Formulae in homebrew/core should not run build-time checks"
problem "Formulae in homebrew/core (except e.g. cryptography, libraries) " \
"should not run build-time checks"
end
end
end

View File

@ -355,7 +355,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do
desc "foo"
url 'https://brew.sh/foo-1.0.tgz'
system "make", "-j1", "test"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Formulae in homebrew/core should not run build-time checks
^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Formulae in homebrew/core (except e.g. cryptography, libraries) should not run build-time checks
end
RUBY
end