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

livecheck: expand typed: strict usage #17632

Merged
merged 1 commit into from
Jul 5, 2024

Conversation

samford
Copy link
Member

@samford samford commented Jul 5, 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?

This updates livecheck files to use typed: script where feasible.

The remaining exception is livecheck/strategy.rb, as I wasn't able to figure out how to resolve the typing issues around the @strategies variable (I tried a couple of approaches but couldn't find a working solution):

livecheck/strategy.rb:100: Use of undeclared variable @strategies https://srb.help/6002
     100 |        return @strategies if defined? @strategies
                         ^^^^^^^^^^^
  Note:
    Use T.let to declare this variable.
    For more information, see https://sorbet.org/docs/type-annotations

livecheck/strategy.rb:102: The instance variable @strategies must be declared using T.let when specifying # typed: strict https://srb.help/7043
     102 |        @strategies = {}
                  ^^^^^^^^^^^
  Autocorrect: Use -a to autocorrect
    livecheck/strategy.rb:102: Replace with T.let({}, T.nilable(T::Hash[T.untyped, T.untyped]))
     102 |        @strategies = {}
                                ^^

livecheck/strategy.rb:100: Use of undeclared variable @strategies https://srb.help/6002
     100 |        return @strategies if defined? @strategies
                         ^^^^^^^^^^^
  Note:
    Use T.let to declare this variable.
    For more information, see https://sorbet.org/docs/type-annotations

livecheck/strategy.rb:102: The instance variable @strategies must be declared using T.let when specifying # typed: strict https://srb.help/7043
     102 |        @strategies = {}
                  ^^^^^^^^^^^
  Autocorrect: Use -a to autocorrect
    livecheck/strategy.rb:102: Replace with T.let({}, T.nilable(T::Hash[T.untyped, T.untyped]))
     102 |        @strategies = {}
                                ^^

This includes changes to resolve the other type errors in strategy.rb but leaves the file as typed: true for now.

Related to #17297.

This updates livecheck files to use `typed: script` where feasible.

The remaining exception is `livecheck/strategy.rb`, as I wasn't
able to figure out how to resolve the typing issues around the
`@strategies` variable (I tried a couple of approaches but couldn't
find a working solution). This includes changes to resolve the other
type errors in `strategy.rb` but leaves the file as `typed: true`
for now.
@samford samford force-pushed the livecheck/expand-typed-strict branch from e2e2b89 to 7ba189a Compare July 5, 2024 00:22
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 @samford!

@MikeMcQuaid MikeMcQuaid merged commit 315437c into Homebrew:master Jul 5, 2024
25 checks passed
@samford samford deleted the livecheck/expand-typed-strict branch July 5, 2024 12:04
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.

2 participants