rubocops/service: allow require_root to be used without run.

Fixes https://github.com/Homebrew/brew/issues/16908
This commit is contained in:
Mike McQuaid 2024-03-19 08:46:47 +00:00
parent e3797d39bd
commit 795642ea97
No known key found for this signature in database

View File

@ -37,7 +37,7 @@ module RuboCop
offending_node(service_node) offending_node(service_node)
problem "Service blocks require `run` or `name` to be defined." problem "Service blocks require `run` or `name` to be defined."
elsif !method_calls.key?(:run) elsif !method_calls.key?(:run)
other_method_calls = method_calls.keys - [:name] other_method_calls = method_calls.keys - [:name, :require_root]
if other_method_calls.any? if other_method_calls.any?
offending_node(service_node) offending_node(service_node)
problem "`run` must be defined to use methods other than `name` like #{other_method_calls}." problem "`run` must be defined to use methods other than `name` like #{other_method_calls}."