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

Narrow member type of inreplace paths enumerable #15800

Merged
merged 2 commits into from
Aug 1, 2023

Conversation

dduugg
Copy link
Member

@dduugg dduugg commented Aug 1, 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?

As suggested in #15796 (comment)
cc @carlocab @MikeMcQuaid

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.

Thanks again @dduugg!

@MikeMcQuaid MikeMcQuaid enabled auto-merge August 1, 2023 16:34
after &&= after.to_s
before = before.to_s if before.is_a?(Pathname)

errors = {}

errors["`paths` (first) parameter"] = ["`paths` was empty"] if paths.blank?
Copy link
Member Author

Choose a reason for hiding this comment

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

Some slight logic change to account for the fact that Enumerable doesn't necessarily define blank?. This is technically more strict ([''] would previously have been ok), but i believe to be semantically correct.

@@ -39,21 +39,22 @@ def initialize(errors)
# @api public
sig {
params(
paths: T.any(T::Array[T.untyped], String, Pathname),
paths: T.any(T::Enumerable[T.any(String, Pathname)], String, Pathname),
Copy link
Member Author

Choose a reason for hiding this comment

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

I believe this needs be widened to allow the super call in the Formula implementation (although sorbet didn't complain).

@MikeMcQuaid MikeMcQuaid merged commit 7994173 into Homebrew:master Aug 1, 2023
@dduugg dduugg deleted the inreplace-paths branch August 1, 2023 17:37
@github-actions github-actions bot added the outdated PR was locked due to age label Sep 1, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 1, 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