From 795642ea97ed1e5989ed1c5cf2862550bd87d2a2 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Tue, 19 Mar 2024 08:46:47 +0000 Subject: [PATCH 1/2] rubocops/service: allow require_root to be used without run. Fixes https://github.com/Homebrew/brew/issues/16908 --- Library/Homebrew/rubocops/service.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Library/Homebrew/rubocops/service.rb b/Library/Homebrew/rubocops/service.rb index 4560cbb4a693a..d711df7d6a0bb 100644 --- a/Library/Homebrew/rubocops/service.rb +++ b/Library/Homebrew/rubocops/service.rb @@ -37,7 +37,7 @@ def audit_formula(_node, _class_node, _parent_class_node, body_node) offending_node(service_node) problem "Service blocks require `run` or `name` to be defined." 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? offending_node(service_node) problem "`run` must be defined to use methods other than `name` like #{other_method_calls}." From 8ba257b6360b15e68e2b4799c120206d4c082cab Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Wed, 20 Mar 2024 08:30:51 +0000 Subject: [PATCH 2/2] Formula-Cookbook: clarify `require_root`. --- docs/Formula-Cookbook.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Formula-Cookbook.md b/docs/Formula-Cookbook.md index f05cf7578a3d6..d96336027ab62 100644 --- a/docs/Formula-Cookbook.md +++ b/docs/Formula-Cookbook.md @@ -970,7 +970,7 @@ end #### Service block methods -This table lists the options you can set within a `service` block. The `run` or `name` field must be defined inside the service block. The `run` field indicates what command to run and is required before using fields other than `name`. +This table lists the options you can set within a `service` block. The `run` or `name` field must be defined inside the service block. The `run` field indicates what command to run and is required before using fields other than `name` and `require_root`. | method | default | macOS | Linux | description | | ----------------------- | ------------ | :---: | :---: | ----------- |