Skip to content

Include inline source files in --save-expectations#2234

Open
ksss wants to merge 2 commits into
soutaro:masterfrom
ksss:fix/inline-save-expectations
Open

Include inline source files in --save-expectations#2234
ksss wants to merge 2 commits into
soutaro:masterfrom
ksss:fix/inline-save-expectations

Conversation

@ksss

@ksss ksss commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Summary

When a target is configured with inline: true, steep check --save-expectations produced an empty YAML (--- []) even when diagnostics were reported, because the inline source files were not collected into all_files.

print_typecheck_result was iterating over target.source_pattern and target.signature_pattern only, missing target.inline_source_pattern. This change adds the missing iteration so inline source files participate in both the populate and prune logic of save_expectations.

Repro

# Steepfile
target :app do
  check "lib", inline: true
end
# lib/foo.rb
1 + "2"
$ steep check --save-expectations
$ cat steep_expectations.yml
--- []

With this fix, steep_expectations.yml correctly contains the lib/foo.rb entry with its diagnostics.

Test plan

  • bundle exec ruby -Itest test/cli_test.rb -n test_check_inline_save_expectations
  • Confirmed the new test fails on master and passes with the fix

🤖 Generated with Claude Code

ksss and others added 2 commits June 5, 2026 23:35
When a target is configured with `inline: true`, the inline source
files were not collected into `all_files`, so `--save-expectations`
produced an empty YAML even when diagnostics were reported.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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.

1 participant