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

brew unbottled: skip deprecated #16116

Merged
merged 2 commits into from
Oct 18, 2023
Merged

brew unbottled: skip deprecated #16116

merged 2 commits into from
Oct 18, 2023

Conversation

iMichka
Copy link
Member

@iMichka iMichka commented Oct 16, 2023

  • 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?

Comment on lines 143 to 145
formulae = formulae&.select {|formula| !(formula.deprecated?)}
all_formulae = all_formulae&.select {|formula| !(formula.deprecated?)}
formula_installs = formula_installs&.select {|formula| !(formula.deprecated?)}
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
formulae = formulae&.select {|formula| !(formula.deprecated?)}
all_formulae = all_formulae&.select {|formula| !(formula.deprecated?)}
formula_installs = formula_installs&.select {|formula| !(formula.deprecated?)}
formulae.reject!(&:deprecated?)
all_formulae.reject!(&:deprecated?)

It looks like formula_installs is just a hash of names to installs that gets referenced based on the formulae in the other lists so removing information there is probably unnecessary.

Copy link
Member Author

Choose a reason for hiding this comment

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

Makes sense, fixed

Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Using Array#reject!(&:deprecated?) here is both more idiomatic Ruby and less code in general.

Copy link
Contributor

@apainintheneck apainintheneck left a comment

Choose a reason for hiding this comment

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

Would it make sense to make this the default?

@MikeMcQuaid
Copy link
Member

Would it make sense to make this the default?

Yes, I think so. I can't think of a situation where you'd actively be trying to bottle deprecated formulae so even the inverse option (--include-deprecated) wouldn't make sense to me either.

We are not interested in bottling them
@iMichka iMichka changed the title brew unbottled: allow to skip deprecated and change format brew unbottled: skip deprecated Oct 17, 2023
@iMichka
Copy link
Member Author

iMichka commented Oct 17, 2023

Makes sense. I changed the logic and I am now always skipping deprecated formulae. Let's gather more insights because there might be edge cases we did not think of.

@MikeMcQuaid
Copy link
Member

Thanks again @iMichka and @apainintheneck for review!

@MikeMcQuaid MikeMcQuaid merged commit ab16b59 into Homebrew:master Oct 18, 2023
27 checks passed
@iMichka iMichka deleted the dep2 branch October 18, 2023 19:02
@github-actions github-actions bot added the outdated PR was locked due to age label Nov 23, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated PR was locked due to age
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants