rspec / rspec-metagem

RSpec meta-gem that depends on the other components
https://rspec.info
MIT License
2.86k stars 235 forks source link

RSpec's plans for sorbet #67

Open leifg opened 2 years ago

leifg commented 2 years ago

I have been recently adopting sorbet into my projects and it greatly helped me with refactoring.

Unfortunately the typechecking errors are not extending to specs due to the DSL nature of RSpec (in general all _spec.rb files have to be typed: false).

I know that there is a project to address some of the runtime issues resulting from using rspec-mocks but I am more talking about the static checking before running the tests. It would achieve a lot of development speed when I could see which problems I need to fix in my spec without running them.

So I am wondering what the general opinion of the RSpec team is. Do you see sorbet features slowly being integrated into the framework or do you know of any third party projects that combine the strict typechecks with the dynamic nature of RSpec.

JonRowe commented 2 years ago

:wave: I personally like the idea of Sorbet, and would have no objections to making roads towards supporting it more amongst the core libraries, but its not something thats currently planned on my end simply as I have no time to work on it. We'd probably also need to add a sorbet build to our CI, which will likely be a huge timesink.

pirj commented 2 years ago

It is getting more complicated as there is also RBS. Can't speak for other core team members, but I personally haven't had a chance to practically apply Sorbet or RBS. I like the idea of rspec-sorbet. Should those who are interested in using Sorbet with RSpec apply their effort there?

Nitrodist commented 2 years ago

https://stackoverflow.com/questions/72100964/sorbet-lsp-sublime-text-read-typed-false 🤔

This also affects me - wish these errors for 'describe', expect, 'let' and 'it' wouldn't pop-up:

Screenshot 2022-06-01 at 2 40 22 AM