This summer I contributed to Homebrew as a part of the Google Summer of Code program. This was my first venture into the world of FOSS and I'm grateful to the Homebrew community for being so welcoming, helpful and encouraging! I worked on setting up Sorbet, a static type checker in our codebase.
Here is a gist of everything that we've worked on during the GSoC period:
-
During the community bonding period, I worked on setting up
byebug
, a popular and easy to use debugger for Ruby. It can be used with any spec and it's usage is similar to the:focus
inclusion filter in rspec. Check out the PR here. I also read through the Sorbet documentation during this period to get a deeper understanding of my project and explored the Homebrew codebase. -
Our next goal was to get
srb tc
up and running. This involved adding relevant gems to our gemfile (in a separateHOMEBREW_SORBET
environment initially), setting upfiles.yaml
, initialisingtapioca
and setting up all gem RBI files. Here are the relevant pull requests for the above tasks: -
Once
srb tc
was running, Sorbet reported a lot of type errors initially. My goal now was to reduce these errors and solve as many type errors as possible. We also had to updatehidden-definitions
regularly and updatetapioca
gem definitions of recently bumped gems. Here are the relevant PRs: -
A very vital part of Sorbet is the
files.yaml
file which contains a list of every Ruby file in the codebase divided into 4 strictness levels, ignore, false, true and strict. Initially we had only 35 files set astrue
. In the next phase, we worked on getting all files fromignore
tofalse
and also moving as many files totrue
. We now have 76 files set as true. In the following set of pull requests, we worked on adding new files tofiles.yaml
, moving existing files totrue
and solving the subsequent type errors.- Homebrew/brew#7822
- Homebrew/brew#7878
- Homebrew/brew#7856
- Homebrew/brew#7884
- Homebrew/brew#7887
- Homebrew/brew#7932
- Homebrew/brew#7933
- Homebrew/brew#7943
- Homebrew/brew#7946
- Homebrew/brew#7962
- Homebrew/brew#7985
- Homebrew/brew#8019
- Homebrew/brew#8028
- Homebrew/brew#8055
- Homebrew/brew#8057
- Homebrew/brew#8065
- Homebrew/brew#8070
- Homebrew/brew#8094
- Homebrew/brew#8101
- Homebrew/brew#8160
- Homebrew/brew#8292
-
Updating tapioca definitions for recently bumped gems was proving to be a tedious chore, hence we worked on adding a new github action which runs periodically and updates all tapioca definitions and hidden-defintions. Link to the PR.
-
Our goal for the third month was to introduce a new developer command,
brew typecheck
, add documentation, and introduce more developers to Sorbet. This was also the right time to drop the separateHOMEBREW_SORBET
environment. Here are the links to the relevant pull requests:
Now, I will be working on getting the remaining files to true. Another thing that
we've got to give a little more thought into, is how we're going to automate adding
new files to the list of in files.yaml
, and more specifically deciding which
sigil we'd want the file to be a part of. I look forward to being an active open source
contributor at Homebrew. 🍺
This summer has been extremely fun and jam packed with important lessons. I've learnt how to approach a problem, how to ask the right questions and I've gained so much confidence in myself as a developer! All of this would have never been possible without the support from my mentors @issyl0, @mistydemeo and @MikeMcQuaid. They've been extremely kind and helpful throughout my GSoC journey. I'm grateful to my mentors for taking out time from their weekends for our weekly video calls (something that I looked forward to all week long!).
My co-interns - @rmnull and @nandahkrishna were super nice and encouraging and I loved sharing my progress with them along the way!
I’d also like to thank Google for giving me the opportunity to be a part of such an amazing community!
Working with the Homebrew community has been a privilege for me and I'm definitely looking forward to making more positive contributions in the future! ❤️