Skip to content

Conversation

@Rylan12
Copy link
Member

@Rylan12 Rylan12 commented Dec 18, 2025

Follow-up to #21215

Now that we have deprecate_args and disable_args in the formula JSON, we should use their presence to determine whether to call deprecate! and disable!.

I changed the predicate methods to deprecate? and disable? to match the other predicates that generally match the DSL method name. Alternately, they could be changed to deprecate_args? and disable_args? if that's more clear.

CC: @Bo98

Copilot AI review requested due to automatic review settings December 18, 2025 15:16
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 refactors the deprecation/disabling predicate logic for formula API loading to use the presence of deprecate_args and disable_args instead of checking for deprecation_date and disable_date. The predicate method names are also changed from deprecated?/disabled? to deprecate?/disable? to better align with the DSL method names (deprecate!/disable!) and match other predicates in the codebase.

Key changes:

  • Predicate methods deprecated?/disabled? renamed to deprecate?/disable? in FormulaStruct
  • Logic changed to check presence of deprecate_args/disable_args instead of deprecation_date/disable_date
  • Added test coverage for future-dated deprecation and disabling scenarios

Reviewed changes

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

Show a summary per file
File Description
Library/Homebrew/api/formula_struct.rb Updated PREDICATES array to use :deprecate and :disable instead of :deprecated and :disabled
Library/Homebrew/api/formula.rb Changed predicate presence checks to use deprecate_args and disable_args instead of date fields
Library/Homebrew/formulary.rb Updated method calls to use new predicate names deprecate? and disable?
Library/Homebrew/sorbet/rbi/dsl/homebrew/api/formula_struct.rbi Updated Sorbet type signatures for renamed predicate methods
Library/Homebrew/test/formulary_spec.rb Added test cases for future-dated deprecation and disabling scenarios, with supporting test data
Files not reviewed (1)
  • Library/Homebrew/sorbet/rbi/dsl/homebrew/api/formula_struct.rbi: Language not supported

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

@Rylan12 Rylan12 force-pushed the fix-deprecate-disable-args branch from acfbe8e to 174cc9b Compare December 19, 2025 01:28
@Rylan12 Rylan12 enabled auto-merge December 19, 2025 01:29
@Rylan12 Rylan12 added this pull request to the merge queue Dec 19, 2025
Merged via the queue into main with commit b344d16 Dec 19, 2025
37 checks passed
@Rylan12 Rylan12 deleted the fix-deprecate-disable-args branch December 19, 2025 01:55
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 for quick fix @Rylan12!

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.

4 participants