-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Sorbet type checking #7782
Comments
At this point, I think all of the initialization and setup is complete. Now the work of adding types begins. |
Something I noticed is that the Sorbet scan always runs. Perhaps it should only run if there are changes to Ruby files? Example : Sorbet In this example, the job took 2m~ of CI time with no benefits |
I don't think it's a huge issue right now, but it could be scoped. I think |
Code improvement description
Sorbet is a type checker for Ruby. It allows for gradual addition of types to an existing codebase and can work for both static and runtime type checking.
Currently, this issue is mainly a placeholder.
Migrate
Layout/DotPosition
fromtrailing
toleading
Sorbet made 1 intentional compatibility break with Ruby syntax relating to multiline method calls which match Ruby keywords. Unfortunately, this happens quite often for RSpec's matchers. For example
and
,or
, etc.The fix is to switch from enforcing
trailing
dot position toleading
with Rubocop, to ensure compatibility with Sorbet. This can be done automatically, but is going to result in a very large diff.Layout/DotPosition
toleading
#7789The above change is going to result in a rather large git diff. To preserve the usefulness of
git blame
a.git-blame-ignore-revs
file should be added at the root of the repository with the git object ID of the above commit..git-blame-ignore-revs-file
and ignore style change #7992Install Sorbet and its dependencies.
Initialise Sorbet
Fix any initial errors
Enforce static type checking as part of the build process
Install and enable the Sorbet RuboCop rules
rubocop-sorbet
#8016Add the Sorbet Visual Studio Code extension to the list of recommended extensions, as well as the Dev Container configuration
The text was updated successfully, but these errors were encountered: