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

feat: add sorbet type checker #83

Merged
merged 2 commits into from
Feb 11, 2022
Merged

feat: add sorbet type checker #83

merged 2 commits into from
Feb 11, 2022

Conversation

peterdeme
Copy link
Contributor

  • Add types. Runtime check is disabled, but static check is enabled.
  • Add type checking to CI

# We will enable it with a major bump in the future,
# but for now, let's just run a static type check.

StringKeyHash = T.type_alias { T::Hash[T.any(String, Symbol), T.untyped] }
Copy link
Contributor

Choose a reason for hiding this comment

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

We had issues with having strings/symbols in maps before, would you think we should allow only symbols here in next major version?

Copy link
Contributor Author

@peterdeme peterdeme Feb 10, 2022

Choose a reason for hiding this comment

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

Agreed. Want me to modify this to this?

SymbolKeyHash = T.type_alias { T::Hash[Symbol, T.untyped] }

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, I think it would be right move.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ffenix113 I looked into it. Unfortunately we rely on string in many places already so right now I wouldn't make that change. Right before bumping to the next major, sure.

image

@peterdeme peterdeme force-pushed the sorbet-typing branch 2 times, most recently from 657e260 to 08ee246 Compare February 10, 2022 14:15
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.

None yet

2 participants