Flag scoped service path helpers#22858
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the RuboCop::Cop::Homebrew::FormulaPathMethods cop to specifically flag and autocorrect Utils::Path.* “scoped” formula path helper calls when they appear inside service do ... end blocks, keeping service DSL usage consistent now that Service includes Utils::Path.
Changes:
- Extend the cop to detect
Utils::Path.formula_*helper calls withinserviceblocks and autocorrect them to the unscoped helper form. - Add RSpec coverage to assert the new offense/correction behavior in
serviceblocks and a non-offense case outside them. - Update the Sorbet RBI for newly introduced node matcher helpers.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| Library/Homebrew/rubocops/formula_path_methods.rb | Adds service-block detection and scoped-helper handling to drive the new offense/autocorrect behavior. |
| Library/Homebrew/test/rubocops/formula_path_methods_spec.rb | Adds tests covering the new service-block offense/correction and a negative case outside service blocks. |
| Library/Homebrew/sorbet/rbi/dsl/rubo_cop/cop/homebrew/formula_path_methods.rbi | Declares the new node matcher helpers for Sorbet. |
Files not reviewed (1)
- Library/Homebrew/sorbet/rbi/dsl/rubo_cop/cop/homebrew/formula_path_methods.rbi: File type not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This was referenced Jun 23, 2026
61d4e8c to
466c31a
Compare
- Keep service DSL helper use consistent after `Service` includes `Utils::Path`. - Leave class-level formula DSL blocks using the scoped form because the bare helper is not available there.
466c31a to
248514d
Compare
There was a problem hiding this comment.
Automated approval by github-actions[bot] for #22858 because all requirements are met:
- #22858 is not from a fork.
- #22858 is not a draft.
- The approval workflow is running on a weekday.
- @MikeMcQuaid is listed as a lead maintainer in README.md.
- @MikeMcQuaid approved Homebrew/brew PR #22888 in the last 7 days.
- #22858 was created at least 48 hours ago and has had no human review since creation.
- Copilot has already reviewed #22858.
- #22858 does not modify
.github/or other sensitive files. - All CI jobs are passing, including non-required jobs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ServiceincludesUtils::Path.brewcommands to reproduce the bug?brew lgtm(style, typechecking and tests) locally?OpenAI Codex 5.5 xhigh with local review and testing.