Merge pull request #11637 from carlocab/runtime-cpu-allowlist

rubocops/lines: check allowlist for use of `ENV.runtime_cpu_detection`
This commit is contained in:
Mike McQuaid 2021-07-02 13:53:30 +01:00 committed by GitHub
commit 83aa3ff258
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -540,6 +540,13 @@ module RuboCop
problem "macOS has been 64-bit only since 10.6 so ENV.universal_binary is deprecated."
end
find_instance_method_call(body_node, "ENV", :runtime_cpu_detection) do
next if tap_style_exception? :runtime_cpu_detection_allowlist
problem "Formulae should be verified as having support for runtime hardware detection before " \
"using ENV.runtime_cpu_detection."
end
find_every_method_call_by_name(body_node, :depends_on).each do |method|
next unless method_called?(method, :new)