-
Notifications
You must be signed in to change notification settings - Fork 376
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
Integrate Sorbet for Static Type Checking #387
Merged
delano
merged 7 commits into
feature/typed
from
386-integrate-sorbet-for-static-type-checking
Jun 11, 2024
Merged
Integrate Sorbet for Static Type Checking #387
delano
merged 7 commits into
feature/typed
from
386-integrate-sorbet-for-static-type-checking
Jun 11, 2024
Conversation
This file contains 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
This change removes the group declaration for development gems and instead configures each gem with require: false to avoid loading them in production. This makes the Gemfile definition more consistent and explicit about which gems are intended for development vs production use. It also addresses a linting issue by removing unused require dependencies in production code.
Sorbet was added to the Gemfile to enable static type checking of Ruby code. This will help catch errors earlier and improve code quality. To enable type checking: - Sorbet was added as a development dependency - Gemfile.lock was updated to resolve dependencies With Sorbet integrated, future work can begin gradually adding type annotations to codebases to take greater advantage of the static analysis it provides. This helps prevent bugs and ensures code behaves as intended.
`bundle exec tapioca init` - Generates Tapioca configuration files, setting up the project for RBI generation. - Creates initial RBI files for gems specified in the Gemfile, aiding Sorbet in type checking external library usage. - If Sorbet is not already initialized, runs `srb init` to set up Sorbet, including generating RBI files for Ruby standard library and project code. - May also include documentation or examples on using Tapioca and Sorbet within the project.
`bundle binstubs bundler` creates a `bin/bundler` script that can be used to manage gem dependencies.
2 tasks
It's large and not in charge of anything in the Docker build process.
Also use snakecase to appease Rubocop.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
documentation
Issues or pull requests related to documentation.
dx
Developer experience working with the project.
improvement
Issues or pull requests that involve improvements to the project.
maintenance
Issues or tasks related to maintenance of the project.
Review effort [1-5]: 3
Pull requests that require a higher level of review effort.
security
Issues or pull requests related to security.
tech debt
Addressing future rework costs due to quick, suboptimal solutions taken previously.
tests
Issues or pull requests that involve testing code.
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.
Implement Sorbet static type checking in the Ruby codebase to enhance code quality and reliability. This pull request includes the following commits:
Standardize development gems and configure require: false
Add type checking with Sorbet
Initialize Tapioca for Sorbet type checking
Integrate Bundler binstub for managing gem deps
The pull request also includes file changes to enable Sorbet and Tapioca, as well as documentation on how to use Sorbet and Tapioca in the project.
Please review and merge this pull request to enable static type checking and improve code safety and readability in the project.
Fixes #386
On merging
In the spirit of gradual adoption, we'll maintain a feature branch for Sorbet and friends to merge into as we familiarize ourselves. We'll keep it up to date with
develop
. That gives us the Big Plus of using Sorbet right away without the risk of making such a significant addition to the codebase.