Open clinejj opened 2 years ago
I seem to have a similar issue. I hit the following exception, which seems to come from some unhandled parsing issue, and then steep
just hangs, which, irrespective of the cause for the exception, is not what I would have expected:
[Steep 0.44.1] [typecheck:typecheck@3] [background] Unexpected error: #<NoMethodError: undefined method `type' for nil:NilClass>
[Steep 0.44.1] [typecheck:typecheck@3] [background] vendor/bundle/ruby/3.0.0/gems/steep-0.44.1/lib/steep/source.rb:88:in `construct_mapping'
[Steep 0.44.1] [typecheck:typecheck@3] [background] vendor/bundle/ruby/3.0.0/gems/steep-0.44.1/lib/steep/source.rb:77:in `parse'
[Steep 0.44.1] [typecheck:typecheck@3] [background] vendor/bundle/ruby/3.0.0/gems/steep-0.44.1/lib/steep/services/type_check_service.rb:324:in `block in type_check_file'
[Steep 0.44.1] [typecheck:typecheck@3] [background] vendor/bundle/ruby/3.0.0/gems/activesupport-6.1.4/lib/active_support/tagged_logging.rb:99:in `block in tagged'
[Steep 0.44.1] [typecheck:typecheck@3] [background] vendor/bundle/ruby/3.0.0/gems/activesupport-6.1.4/lib/active_support/tagged_logging.rb:37:in `tagged'
[Steep 0.44.1] [typecheck:typecheck@3] [background] vendor/bundle/ruby/3.0.0/gems/activesupport-6.1.4/lib/active_support/tagged_logging.rb:99:in `tagged'
[Steep 0.44.1] [typecheck:typecheck@3] [background] vendor/bundle/ruby/3.0.0/gems/steep-0.44.1/lib/steep/services/type_check_service.rb:323:in `type_check_file'
[Steep 0.44.1] [typecheck:typecheck@3] [background] vendor/bundle/ruby/3.0.0/gems/steep-0.44.1/lib/steep/services/type_check_service.rb:279:in `block (2 levels) in typecheck_source'
[Steep 0.44.1] [typecheck:typecheck@3] [background] vendor/bundle/ruby/3.0.0/gems/steep-0.44.1/lib/steep.rb:164:in `measure'
[Steep 0.44.1] [typecheck:typecheck@3] [background] vendor/bundle/ruby/3.0.0/gems/steep-0.44.1/lib/steep/services/type_check_service.rb:273:in `block in typecheck_source'
[Steep 0.44.1] [typecheck:typecheck@3] [background] vendor/bundle/ruby/3.0.0/gems/activesupport-6.1.4/lib/active_support/tagged_logging.rb:99:in `block in tagged'
[Steep 0.44.1] [typecheck:typecheck@3] [background] vendor/bundle/ruby/3.0.0/gems/activesupport-6.1.4/lib/active_support/tagged_logging.rb:37:in `tagged'
[Steep 0.44.1] [typecheck:typecheck@3] [background] vendor/bundle/ruby/3.0.0/gems/activesupport-6.1.4/lib/active_support/tagged_logging.rb:99:in `tagged'
[Steep 0.44.1] [typecheck:typecheck@3] [background] vendor/bundle/ruby/3.0.0/gems/steep-0.44.1/lib/steep/services/type_check_service.rb:272:in `typecheck_source'
[Steep 0.44.1] [typecheck:typecheck@3] [background] vendor/bundle/ruby/3.0.0/gems/steep-0.44.1/lib/steep/server/type_check_worker.rb:182:in `handle_job'
[Steep 0.44.1] [typecheck:typecheck@3] [background] vendor/bundle/ruby/3.0.0/gems/steep-0.44.1/lib/steep/server/base_worker.rb:53:in `block (2 levels) in run'
[Steep 0.44.1] [typecheck:typecheck@3] [background] vendor/bundle/ruby/3.0.0/gems/activesupport-6.1.4/lib/active_support/tagged_logging.rb:99:in `block in tagged'
[Steep 0.44.1] [typecheck:typecheck@3] [background] vendor/bundle/ruby/3.0.0/gems/activesupport-6.1.4/lib/active_support/tagged_logging.rb:37:in `tagged'
[Steep 0.44.1] [typecheck:typecheck@3] [background] vendor/bundle/ruby/3.0.0/gems/activesupport-6.1.4/lib/active_support/tagged_logging.rb:99:in `tagged'
[Steep 0.44.1] [typecheck:typecheck@3] [background] vendor/bundle/ruby/3.0.0/gems/steep-0.44.1/lib/steep/server/base_worker.rb:43:in `block in run'
steep
0.43.1 showed the same problem, but it seems 0.42.0 does not.
I've experienced this as well. I find that if I use Ruby version 3.1.1 on an Intel Mac ([x86_64-darwin21]
) with Steep version 1.4.0 this does not occur.
It was reproducible with Steep version 1.4.0 with Ruby version 3.0.2.
When classes that are specified as a library in the
Steepfile
have a syntax error, thesteep check
executable hangs and requires a force quit to end the process.Example: Generate type definitions using rbs for
activerecord
:Reference
lib/sig
as arepo_path
in theSteepfile
Runsteep check
, and you will see a similar error:but the process will not have exited.
I would expect the process to exit with a failure status code if it runs into a syntax error.