Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix print error with absolute path #508

Merged
merged 2 commits into from
Mar 11, 2022

Conversation

matsubara0507
Copy link
Contributor

Steep command is could execute for sub project:

$ bundle exec -- steep check --steepfile=sample/Steepfile
# Type checking files:

..................................................................

No type error detected. 🫖

But, raise exception when type check is failed:

$ bundle exec -- steep check --steepfile=sample/Steepfile
# Type checking files:

...............................................FF.................

#<Errno::ENOENT: No such file or directory @ rb_sysopen - lib/conference.rb>
  /path/to/steep/lib/steep/drivers/check.rb:218:in `read'
  /path/to/steep/lib/steep/drivers/check.rb:218:in `read'
  /path/to/steep/lib/steep/drivers/check.rb:218:in `block in print_result'
  /path/to/steep/lib/steep/drivers/check.rb:216:in `each'
  /path/to/steep/lib/steep/drivers/check.rb:216:in `print_result'
  /path/to/steep/lib/steep/drivers/check.rb:125:in `run'
  /path/to/steep/lib/steep/cli.rb:110:in `process_check'
  /path/to/steep/lib/steep/cli.rb:52:in `run'
  /path/to/steep/exe/steep:11:in `<top (required)>'
  /path/to/steep/vendor/gems/ruby/3.1.0/bin/steep:25:in `load'
  /path/to/steep/vendor/gems/ruby/3.1.0/bin/steep:25:in `<top (required)>'
  /path/to/steep/vendor/gems/ruby/3.1.0/gems/bundler-2.3.8/lib/bundler/cli/exec.rb:58:in `load'
  /path/to/steep/vendor/gems/ruby/3.1.0/gems/bundler-2.3.8/lib/bundler/cli/exec.rb:58:in `kernel_load'
  /path/to/steep/vendor/gems/ruby/3.1.0/gems/bundler-2.3.8/lib/bundler/cli/exec.rb:23:in `run'
  /path/to/steep/vendor/gems/ruby/3.1.0/gems/bundler-2.3.8/lib/bundler/cli.rb:484:in `exec'
  /path/to/steep/vendor/gems/ruby/3.1.0/gems/bundler-2.3.8/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
  /path/to/steep/vendor/gems/ruby/3.1.0/gems/bundler-2.3.8/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
  /path/to/steep/vendor/gems/ruby/3.1.0/gems/bundler-2.3.8/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
  /path/to/steep/vendor/gems/ruby/3.1.0/gems/bundler-2.3.8/lib/bundler/cli.rb:31:in `dispatch'
  /path/to/steep/vendor/gems/ruby/3.1.0/gems/bundler-2.3.8/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
  /path/to/steep/vendor/gems/ruby/3.1.0/gems/bundler-2.3.8/lib/bundler/cli.rb:25:in `start'
  /path/to/steep/vendor/gems/ruby/3.1.0/gems/bundler-2.3.8/exe/bundle:48:in `block in <top (required)>'
  /path/to/steep/vendor/gems/ruby/3.1.0/gems/bundler-2.3.8/lib/bundler/friendly_errors.rb:103:in `with_friendly_errors'
  /path/to/steep/vendor/gems/ruby/3.1.0/gems/bundler-2.3.8/exe/bundle:36:in `<top (required)>'
  /.rbenv/versions/3.1.1/bin/bundle:25:in `load'
  /.rbenv/versions/3.1.1/bin/bundle:25:in `<main>'

Reason is that use relative_path to read file in print_result.
So, changed to absolute_path.

lib/steep/drivers/check.rb Outdated Show resolved Hide resolved
@soutaro soutaro enabled auto-merge March 11, 2022 09:07
Copy link
Owner

@soutaro soutaro left a comment

Choose a reason for hiding this comment

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

👏

@soutaro soutaro merged commit 5d7abda into soutaro:master Mar 11, 2022
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.

2 participants