Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Mar 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Library/Homebrew/rubocops/service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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}."
Expand Down
2 changes: 1 addition & 1 deletion docs/Formula-Cookbook.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
| ----------------------- | ------------ | :---: | :---: | ----------- |
Expand Down