rubocops/lines: be less strict about OS.{mac,linux}? in taps.

Fixes #12040.
This commit is contained in:
Mike McQuaid 2021-09-15 12:23:07 +01:00
parent 1e83399e31
commit 56753c9d08
No known key found for this signature in database
GPG Key ID: 3338A31AFDB1D829

View File

@ -394,6 +394,12 @@ module RuboCop
end
end
# Don't restrict OS.mac? or OS.linux? usage in taps; they don't care
# as much as we do about e.g. formulae.brew.sh generation, often use
# platform-specific URLs and we don't want to add DSLs to support
# that case.
next if formula_tap != "homebrew-core"
find_instance_method_call(body_node, "OS", if_method_name) do |method|
valid = T.let(false, T::Boolean)
method.each_ancestor do |ancestor|