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

adding sorbet types for elm file parser #11440

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

robaiken
Copy link
Contributor

@robaiken robaiken commented Jan 29, 2025

What are you trying to accomplish?

Add sorbet types to: elm/lib/dependabot/elm/file_parser.rb

How will you know you've accomplished your goal?

All tests should continue to pass as before and there shouldn't be any new sorbet runtime errors in Sentry

Checklist

  • I have run the complete test suite to ensure all tests and linters pass.
  • I have thoroughly tested my code changes to ensure they work as expected, including adding additional tests for new functionality.
  • I have written clear and descriptive commit messages.
  • I have provided a detailed description of the changes in the pull request, including the problem it addresses, how it fixes the problem, and any relevant details about the implementation.
  • I have ensured that the code is well-documented and easy to understand.

@github-actions github-actions bot added the L: elm Elm packages label Jan 29, 2025
@robaiken robaiken marked this pull request as ready for review February 3, 2025 16:13
@robaiken robaiken requested a review from a team as a code owner February 3, 2025 16:13
@robaiken robaiken force-pushed the robaiken/adding-sorbet-types-for-elm-file-parser branch from c111a54 to d55529e Compare February 3, 2025 16:13
@robaiken robaiken self-assigned this Feb 4, 2025

sig { override.returns(T::Array[Dependabot::Dependency]) }
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think you actually need override here

@@ -149,7 +162,8 @@ def build_elm_json_dependency(name:, group:, requirement:, direct:)

sig { returns(String) }
def repo_type
parsed_elm_json.fetch("type")
type = parsed_elm_json.fetch("type")
T.must(type.is_a?(String) ? type : nil)
Copy link
Contributor

@amazimbe amazimbe Feb 4, 2025

Choose a reason for hiding this comment

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

Not sure what this is doing but I think the result is nilable so I don't think the signature should be sig { returns(String) }

@@ -167,12 +186,17 @@ def version_for(version_requirement)
req.requirements.first.last
end

sig { returns(T::Hash[String, T.any(String, T::Hash[String, T.any(String, T::Hash[String, String])])]) }
Copy link
Contributor

@amazimbe amazimbe Feb 4, 2025

Choose a reason for hiding this comment

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

I would monitor this after deploying. It's too precise and it wouldn't surprise me if it starts erroring.

@JamieMagee JamieMagee added the sorbet 🍦 Relates to Sorbet types label Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
L: elm Elm packages sorbet 🍦 Relates to Sorbet types
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants