Skip to content

Commit

Permalink
Add documentation for the annotations command
Browse files Browse the repository at this point in the history
Signed-off-by: Alexandre Terrasa <alexandre.terrasa@shopify.com>
  • Loading branch information
Morriar committed Jun 1, 2022
1 parent 91c6cc2 commit 352d406
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,30 @@ Nothing to do, all RBIs are up-to-date.
This option can be used on CI to make sure the RBI files are always up-to-date and ensure accurate type checking. **Warning**: doing so will break your normal Dependabot workflow as every pull-request opened to bump a gem version will fail CI since the RBI will be out-of-date and will require you to manually run `bin/tapioca gems` to update them.
### Pulling RBI annotations from remote sources
Since Tapioca does not perform any type inference, the RBI files generated for the gems do not contain any type signatures. Instead, Tapioca relies on the community to provide high-quality, manually written RBI annotations for public gems.
To pull the annotations relevant to your project from the central repository, run the `annotations` command:
```shell
bin/tapioca annotations
```
By default, Tapioca will pull the annotations stored in the central repository located at https://github.com/Shopify/rbi-central. It is possible to use a custom repository by changing the value of the `--sources` options. For example if your repository is stored on Github:
```shell
bin/tapioca annotations --sources https://raw.githubusercontent.com/$USER/$REPO/$BRANCH
```
Tapioca also supports pulling annotations from multiple sources:
```shell
bin/tapioca annotations --sources https://raw.githubusercontent.com/$USER/$REPO1/$BRANCH https://raw.githubusercontent.com/$USER/$REPO2/$BRANCH
```
> Note: support for private repositories is not yet implemented.
### Generating RBI files for Rails and other DSLs
Sorbet by itself does not understand DSLs involving meta-programming, such as Rails. This means that Sorbet won't know about constants and methods generated by `ActiveRecord` or `ActiveSupport`.
Expand Down

0 comments on commit 352d406

Please sign in to comment.