Skip to content

Flag scoped service path helpers#22858

Merged
MikeMcQuaid merged 1 commit into
mainfrom
formula-path-methods-service-helpers
Jun 26, 2026
Merged

Flag scoped service path helpers#22858
MikeMcQuaid merged 1 commit into
mainfrom
formula-path-methods-service-helpers

Conversation

@MikeMcQuaid

Copy link
Copy Markdown
Member
  • 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.

  • Have you followed our Contributing guidelines?
  • Have you checked for other open Pull Requests for the same change?
  • Have you explained what your changes do? Performance claims (e.g. "this is faster") must include Hyperfine benchmarks.
  • Have you explained why you'd like these changes included, not just what they do?
  • For bug fixes, have you given step-by-step brew commands to reproduce the bug?
  • Have you written new tests (excluding integration tests)? Here's an example.
  • Have you successfully run brew lgtm (style, typechecking and tests) locally?

  • AI was used to generate or assist with generating this PR.

OpenAI Codex 5.5 xhigh with local review and testing.


Copilot AI review requested due to automatic review settings June 23, 2026 08:36

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 within service blocks and autocorrect them to the unscoped helper form.
  • Add RSpec coverage to assert the new offense/correction behavior in service blocks 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.

- 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.
@MikeMcQuaid MikeMcQuaid force-pushed the formula-path-methods-service-helpers branch from 466c31a to 248514d Compare June 26, 2026 18:08
@MikeMcQuaid MikeMcQuaid enabled auto-merge June 26, 2026 18:13

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@MikeMcQuaid MikeMcQuaid added this pull request to the merge queue Jun 26, 2026
Merged via the queue into main with commit 2dc7c3f Jun 26, 2026
46 checks passed
@MikeMcQuaid MikeMcQuaid deleted the formula-path-methods-service-helpers branch June 26, 2026 19:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants