sorbet-rails icon indicating copy to clipboard operation
sorbet-rails copied to clipboard

Feature Request: --verify option for CI

Open bmulholland opened this issue 3 years ago • 1 comments

Problem: It's very easy to make a change and forget to refresh the generated objects, resulting in out-of-sync RBIs

It's possible to run the generation as a git hook, but this can slow things down, and there's no way to guarantee that the hook runs anyway.

I'd like to add a check to my CI that guarantees that the models are up to date so that CI can fail changes that don't do this properly. tapioca just added a --verify option - is that possible for this project, too?

bmulholland avatar Jun 24 '21 19:06 bmulholland

👍 for this. We have a similar CI check as a shell script:

#!/bin/sh

set -e

cp -R sorbet sorbet.checked

# ...

bundle exec rails rails_rbi:helpers
bundle exec rails rails_rbi:jobs
bundle exec rails rails_rbi:mailers
bundle exec rails rails_rbi:models
bundle exec rails rails_rbi:routes

diff --brief --recursive sorbet sorbet.checked

# ...

smt116 avatar Dec 21 '21 14:12 smt116