The summary: As far as I can tell, when I run srb init
, it requires every single file. Is there a way to disable or customize this behavior before the config is generated in sorbet/
?
I run into some trouble with this since my team keeps gems in a non-standard location (it's a polyglot monorepo.) In particular, I'd like to tell Sorbet to ignore things in _build
, db
, and script
—short of adding a typed: ignore
to every file (apparently this won't work for us due to how gems are being set up) how can I make Sorbet ignore these?
(some background: we tried to adopt Sorbet's static checks when it first came out and could not because we use Rails and the tooling was not working well enough yet. We found the runtime checks really useful, however, and so we've been using those extensively. I've been re-evaluating the static side every couple of months, and have been consistently gotten stuck when trying to create the sorbet
directory!)
I believe you can start by creating and modifying the config file accordingly and then running the whole process. You can acomplish this by running srb rbi config
first, and then adding a line like --ignore=db/
to the newly created file at ./sorbet/config
.
For multiple directories you can put one on each line:
--dir
.
--ignore=db/
--ignore=vendor/