Spike/add type sigs - #44
Open
ajtucker wants to merge 13 commits into
Open
Conversation
joescottdave
force-pushed
the
spike/add-type-sigs
branch
from
August 18, 2026 13:54
2aa7eec to
4c47db9
Compare
```shell rbs collection init rbs collection install ```
```shell for rb in lib/data_services_api/*.rb; do rbs prototype rb $rb > sig/data_services_api/$(basename $rb)s; done ```
…ruby-lang.org/en/master/JSON.html#module-json-output-options). For consistency, use string keys in the Value hash.
joescottdave
force-pushed
the
spike/add-type-sigs
branch
from
August 19, 2026 13:31
97f5f5f to
9be2c0b
Compare
joescottdave
approved these changes
Aug 19, 2026
joescottdave
left a comment
Contributor
There was a problem hiding this comment.
I'm not really familiar with any of Ruby's type-checking systems, but this is (I'm told) the way the wind is blowing if you want types in Ruby. This gem seems as good a place as any to try them out.
All looks sound to me so far.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ruby now has support for writing type signature files and running static type checking. The type signatures can be bundled in a Gem for use in type checking downstream apps.
This PR:
rbs prototype:For now, we just report any errors, using
bundle exec steep check --severity-level=error.Note that the
Valueclass has been changed slightly: it assumed that hash keys would be symbols, but by defaultJSON.parsewill use strings for keys unless told otherwise. This may affect downstream use, but we should be able to use the type checker to tell us.The type signatures for dependent gems are not stored in git, but there is a lockfile to ensure that the same versions are downloaded when running the type checker e.g. in the GitHub action. The lockfile can be updated with
rbs collection update