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

formula: allow excluding deprecate! reason when disable! exists #18661

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cho-m
Copy link
Member

@cho-m cho-m commented Oct 30, 2024

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes? Here's an example.
  • Have you successfully run brew style with your changes locally?
  • Have you successfully run brew typecheck with your changes locally?
  • Have you successfully run brew tests with your changes locally?

@cho-m cho-m mentioned this pull request Oct 30, 2024
7 tasks
@cho-m cho-m force-pushed the deprecate-disable-at-once branch from 5cb0d67 to c113c8e Compare October 30, 2024 03:01
@cho-m
Copy link
Member Author

cho-m commented Oct 30, 2024

For convenience, I've set @deprecation_reason even if before @deprecation_date. I don't think this should be an issue and information can be used on formulae page or by 3rd-party usage of API.

Otherwise, would have to deal with resetting the info to nil.

@p-linnane
Copy link
Member

This is a fantastic idea. Thanks @cho-m!

class Foo < Formula
url 'https://brew.sh/foo-1.0.tgz'
disable! date: "2021-08-28", because: :does_not_build
deprecate! date: "2020-08-28"
Copy link
Member

Choose a reason for hiding this comment

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

Not really relevant for this PR, but are these automatically sorted in this order by another cop? To me it would make more sense to have deprecate! sorted first.

Copy link
Member Author

Choose a reason for hiding this comment

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

It is from AST order:

[{ name: :disable!, type: :method_call }],
[{ name: :deprecate!, type: :method_call }],

Could reverse them if we wanted, though would need to make sure about handling. I did try to add code so order doesn't matter.

@cho-m cho-m added the in progress Maintainers are working on this label Nov 10, 2024
@cho-m
Copy link
Member Author

cho-m commented Nov 10, 2024

Will wait until after #18733 is merged to finish this up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in progress Maintainers are working on this
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants