srb rbi suggest-typed
internally runs srb tc --typed=strict --error-white-list=7022 --suggest-typed -a
--error-white-list
means "only output errors of this kind", and 7022 is the error that is used to suggest a type. therefore, this runs sorbet at typed: strict
across the board, and then outputs errors with type suggestions where appropriate.
THE PROBLEM is that when we run this on our (big) codebase, a bunch of files get downgraded to typed: ignore
. but if we run srb tc
on the same codebase, with higher sigils (eg. typed: true
) on those files, there's no errors.
the type sorbet suggests is one level lower than the file's current min error level: https://github.com/sorbet/sorbet/blob/c33b7e2e41657b482a631e2edb931258995406bc/main/realmain.cc#L525
errors have a minLevel that comes from their what
, which is an ErrorClass: https://github.com/sorbet/sorbet/blob/09fc62528d3b25357e297b594e699ab096d8b12d/core/Error.h#L132.