Merge pull request #12062 from MikeMcQuaid/less_strict_if_os

rubocops/lines: be less strict about `OS.{mac,linux}?` in taps.
This commit is contained in:
Mike McQuaid 2021-09-15 12:39:41 +01:00 committed by GitHub
commit b19fcef629
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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|