Merge pull request #16914 from Homebrew/service_require_root_no_run

rubocops/service: allow require_root to be used without run.
This commit is contained in:
Mike McQuaid 2024-03-20 08:42:34 +00:00 committed by GitHub
commit 91d670c3fa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -37,7 +37,7 @@ module RuboCop
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}."

View File

@ -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 |
| ----------------------- | ------------ | :---: | :---: | ----------- |