Skip to content

Use typed override for spoom bump#966

Open
Morriar wants to merge 1 commit into
mainfrom
at-bump-typed-override
Open

Use typed override for spoom bump#966
Morriar wants to merge 1 commit into
mainfrom
at-bump-typed-override

Conversation

@Morriar

@Morriar Morriar commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Run Sorbet with a temporary --typed-override file when checking bump candidates instead of rewriting sigils before type checking.

Run Sorbet with a temporary --typed-override file when checking bump candidates instead of rewriting sigils before typechecking.

Reject projects that already configure --typed-override to avoid conflicting overrides, and assert temporary override files are cleaned up in bump tests.
@Morriar Morriar self-assigned this Jun 29, 2026
@Morriar Morriar requested a review from a team as a code owner June 29, 2026 19:06
Comment thread lib/spoom/cli/srb/bump.rb
Sorbet::Sigils.change_sigil_in_files(files, from_strictness)
#: (Spoom::Context context, Array[String] files, String strictness) -> String
def write_typed_override_file(context, files, strictness)
path = ".spoom-typed-override-#{Process.pid}-#{SecureRandom.hex(8)}.yaml"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't we just use Tempfile.new(['spoom-typed-override', '.yml'])?

Then there's no need to have it hidden with the prefixed .

Comment thread lib/spoom/cli/srb/bump.rb
relative_path = file.delete_prefix("#{context.absolute_path}/")
"./#{relative_path}"
end
context.write!(path, YAML.dump({ strictness => relative_paths }))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we delete the file when we're done?
Is that was using context helps with?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants