Unverified Commit 1ffbcc04 authored by Carlo Cabrera's avatar Carlo Cabrera
Browse files

rubocops/lines: allow `OS.foo?` in `service` blocks

These seem more natural, and I don't think we need to be able to mock
service blocks on other OSs.

See Homebrew/homebrew-core#90091.
parent 4c3f3253
......@@ -354,7 +354,7 @@ module RuboCop
def audit_formula(_node, _class_node, _parent_class_node, body_node)
no_on_os_method_names = [:install, :post_install].freeze
no_on_os_block_names = [:test].freeze
no_on_os_block_names = [:service, :test].freeze
[[:on_macos, :mac?], [:on_linux, :linux?]].each do |on_method_name, if_method_name|
if_method_and_class = "if OS.#{if_method_name}"
no_on_os_method_names.each do |formula_method_name|
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment