Skip to content

Conversation

@Rylan12
Copy link
Member

@Rylan12 Rylan12 commented Dec 11, 2025

I noticed that we don't include all of the deprecate and disable! arguments in the formula API, we only include them if the deprecation/disable date is active (i.e. before today).

This PR adds deprecate_args and disable_args fields to the API that contain all of the arguments passed to deprecate! and disable!, regardless of whether the deprecation/disable is active. This will allow the API to replicate the exact deprecate!/disable! call that is used in the formula file. I have a follow-up PR ready to handle this once this change is merged and makes it through the API generation.

Copilot AI review requested due to automatic review settings December 11, 2025 14:39
Copy link
Contributor

Copilot AI left a comment

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 adds deprecate_args and disable_args fields to the Formula class to capture all arguments passed to deprecate! and disable! methods, regardless of whether the deprecation/disable is currently active. This enables the API to replicate the exact method calls used in formula files, supporting a follow-up PR that will handle API generation with these new fields.

  • Adds @deprecate_args and @disable_args instance variables to store the full argument hashes
  • Exposes these arguments through delegate methods and includes them in the to_hash output
  • Includes a minor typo fix in the disable! deprecation message
  • Removes unnecessary T.must wrapper in the deprecate! method

Reviewed changes

Copilot reviewed 1 out of 2 changed files in this pull request and generated 2 comments.

File Description
Library/Homebrew/sorbet/rbi/dsl/formula.rbi Adds Sorbet type signatures for new deprecate_args and disable_args methods
Library/Homebrew/formula.rb Implements storage and delegation of deprecation/disable arguments, adds them to API hash output, includes minor code cleanup
Files not reviewed (1)
  • Library/Homebrew/sorbet/rbi/dsl/formula.rbi: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Rylan12 Rylan12 force-pushed the include-all-deprecate-disable-args-in-api branch from 1384a35 to 75c9bf7 Compare December 11, 2025 14:46
Copy link
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

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

Makes sense, thanks!

@MikeMcQuaid MikeMcQuaid added this pull request to the merge queue Dec 11, 2025
Merged via the queue into main with commit dc7c173 Dec 11, 2025
37 checks passed
@MikeMcQuaid MikeMcQuaid deleted the include-all-deprecate-disable-args-in-api branch December 11, 2025 15:31
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.

3 participants