-
-
Notifications
You must be signed in to change notification settings - Fork 69
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
After upgrade to 1.2.1 got "anonymous block parameter is also used within block" #284
Comments
@elct9620 it's a bug in ruby 3.3.0, see https://bugs.ruby-lang.org/issues/20090 You'll need to upgrade to 3.3.1 or higher |
Thanks for your information. I find the root cause is |
Currently the `reek` plugin is failing for customers. The stack trace for these customers looks like this: ``` 2025-01-22T18:03:07Z INFO [T13] qlty_check::tool (47.8 MB): Setting up tool reek@Some("6.3.0"). Logging to /home/runner/.qlty/cache/tools/reek/6.3.0-fb49277b68e3-install.log 2025-01-22T18:03:20Z ERROR [T13] qlty_check::tool (47.8 MB): Failed to get version for package "reek": Output { status: ExitStatus(unix_wait_status(256)), stdout: "", stderr: "<internal:/home/runner/.qlty/cache/tools/ruby/3.3.0-bbe397d161fc/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:127:in `require': \n/home/runner/.qlty/cache/tools/reek/6.3.0-fb49277b68e3/gems/dry-types-1.8.1/lib/dry/types/sum.rb:33: anonymous block parameter is also used within block (SyntaxError)\n\tfrom <internal:/home/runner/.qlty/cache/tools/ruby/3.3.0-bbe397d161fc/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:127:in `require'\n\tfrom /home/runner/.qlty/cache/tools/reek/6.3.0-fb49277b68e3/gems/zeitwerk-2.7.1/lib/zeitwerk/core_ext/kernel.rb:26:in `require'\n\tfrom /home/runner/.qlty/cache/tools/reek/6.3.0-fb49277b68e3/gems/dry-types-1.8.1/lib/dry/types/builder.rb:28:in `|'\n\tfrom /home/runner/.qlty/cache/tools/reek/6.3.0-fb49277b68e3/gems/dry-types-1.8.1/lib/dry/types/builder.rb:53:in `optional'\n\tfrom /home/runner/.qlty/cache/tools/reek/6.3.0-fb49277b68e3/gems/dry-types-1.8.1/lib/dry/types/core.rb:79:in `block in <module:Types>'\n\tfrom /home/runner/.qlty/cache/tools/reek/6.3.0-fb49277b68e3/gems/dry-types-1.8.1/lib/dry/types/core.rb:78:in `each_key'\n\tfrom /home/runner/.qlty/cache/tools/reek/6.3.0-fb49277b68e3/gems/dry-types-1.8.1/lib/dry/types/core.rb:78:in `<module:Types>'\n\tfrom /home/runner/.qlty/cache/tools/reek/6.3.0-fb49277b68e3/gems/dry-types-1.8.1/lib/dry/types/core.rb:4:in `<module:Dry>'\n\tfrom /home/runner/.qlty/cache/tools/reek/6.3.0-fb49277b68e3/gems/dry-types-1.8.1/lib/dry/types/core.rb:3:in `<top (required)>'\n\tfrom <internal:/home/runner/.qlty/cache/tools/ruby/3.3.0-bbe397d161fc/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:127:in `require'\n\tfrom <internal:/home/runner/.qlty/cache/tools/ruby/3.3.0-bbe397d161fc/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:127:in `require'\n\tfrom /home/runner/.qlty/cache/tools/reek/6.3.0-fb49277b68e3/gems/zeitwerk-2.7.1/lib/zeitwerk/core_ext/kernel.rb:34:in `require'\n\tfrom /home/runner/.qlty/cache/tools/reek/6.3.0-fb49277b68e3/gems/dry-types-1.8.1/lib/dry/types.rb:258:in `<top (required)>'\n\tfrom <internal:/home/runner/.qlty/cache/tools/ruby/3.3.0-bbe397d161fc/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:127:in `require'\n\tfrom <internal:/home/runner/.qlty/cache/tools/ruby/3.3.0-bbe397d161fc/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:127:in `require'\n\tfrom /home/runner/.qlty/cache/tools/reek/6.3.0-fb49277b68e3/gems/zeitwerk-2.7.1/lib/zeitwerk/core_ext/kernel.rb:34:in `require'\n\tfrom /home/runner/.qlty/cache/tools/reek/6.3.0-fb49277b68e3/gems/dry-schema-1.13.4/lib/dry/schema.rb:8:in `<top (required)>'\n\tfrom <internal:/home/runner/.qlty/cache/tools/ruby/3.3.0-bbe397d161fc/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:127:in `require'\n\tfrom <internal:/home/runner/.qlty/cache/tools/ruby/3.3.0-bbe397d161fc/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:127:in `require'\n\tfrom /home/runner/.qlty/cache/tools/reek/6.3.0-fb49277b68e3/gems/reek-6.3.0/lib/reek/configuration/schema.rb:3:in `<top (required)>'\n\tfrom /home/runner/.qlty/cache/tools/reek/6.3.0-fb49277b68e3/gems/reek-6.3.0/lib/reek/configuration/schema_validator.rb:4:in `require_relative'\n\tfrom /home/runner/.qlty/cache/tools/reek/6.3.0-fb49277b68e3/gems/reek-6.3.0/lib/reek/configuration/schema_validator.rb:4:in `<top (required)>'\n\tfrom /home/runner/.qlty/cache/tools/reek/6.3.0-fb49277b68e3/gems/reek-6.3.0/lib/reek/configuration/configuration_file_finder.rb:5:in `require_relative'\n\tfrom /home/runner/.qlty/cache/tools/reek/6.3.0-fb49277b68e3/gems/reek-6.3.0/lib/reek/configuration/configuration_file_finder.rb:5:in `<top (required)>'\n\tfrom /home/runner/.qlty/cache/tools/reek/6.3.0-fb49277b68e3/gems/reek-6.3.0/lib/reek/configuration/app_configuration.rb:4:in `require_relative'\n\tfrom /home/runner/.qlty/cache/tools/reek/6.3.0-fb49277b68e3/gems/reek-6.3.0/lib/reek/configuration/app_configuration.rb:4:in `<top (required)>'\n\tfrom /home/runner/.qlty/cache/tools/reek/6.3.0-fb49277b68e3/gems/reek-6.3.0/lib/reek/detector_repository.rb:5:in `require_relative'\n\tfrom /home/runner/.qlty/cache/tools/reek/6.3.0-fb49277b68e3/gems/reek-6.3.0/lib/reek/detector_repository.rb:5:in `<top (required)>'\n\tfrom /home/runner/.qlty/cache/tools/reek/6.3.0-fb49277b68e3/gems/reek-6.3.0/lib/reek/examiner.rb:4:in `require_relative'\n\tfrom /home/runner/.qlty/cache/tools/reek/6.3.0-fb49277b68e3/gems/reek-6.3.0/lib/reek/examiner.rb:4:in `<top (required)>'\n\tfrom /home/runner/.qlty/cache/tools/reek/6.3.0-fb49277b68e3/gems/reek-6.3.0/lib/reek.rb:7:in `require_relative'\n\tfrom /home/runner/.qlty/cache/tools/reek/6.3.0-fb49277b68e3/gems/reek-6.3.0/lib/reek.rb:7:in `<top (required)>'\n\tfrom /home/runner/.qlty/cache/tools/reek/6.3.0-fb49277b68e3/gems/reek-6.3.0/bin/reek:9:in `require_relative'\n\tfrom /home/runner/.qlty/cache/tools/reek/6.3.0-fb49277b68e3/gems/reek-6.3.0/bin/reek:9:in `<top (required)>'\n\tfrom /home/runner/.qlty/cache/tools/reek/6.3.0-fb49277b68e3/bin/reek:25:in `load'\n\tfrom /home/runner/.qlty/cache/tools/reek/6.3.0-fb49277b68e3/bin/reek:25:in `<main>'\n" } {"LD_LIBRARY_PATH": "/home/runner/.qlty/cache/tools/ruby/3.3.0-bbe397d161fc/lib", "PKG_CONFIG_PATH": "/home/runner/.qlty/cache/tools/ruby/3.3.0-bbe397d161fc/lib/pkgconfig", "GEM_HOME": "/home/runner/.qlty/cache/tools/reek/6.3.0-fb49277b68e3", "HOME": "/home/runner", "PATH": "/home/runner/.qlty/cache/tools/reek/6.3.0-fb49277b68e3/bin:/home/runner/.qlty/cache/tools/reek/6.3.0-fb49277b68e3:/home/runner/.qlty/cache/tools/ruby/3.3.0-bbe397d161fc/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin", "GEM_PATH": "/home/runner/.qlty/cache/tools/reek/6.3.0-fb49277b68e3", "RUBYLIB": "/home/runner/.qlty/cache/tools/ruby/3.3.0-bbe397d161fc/lib/ruby/site_ruby/3.3.0:/home/runner/.qlty/cache/tools/ruby/3.3.0-bbe397d161fc/lib/ruby/site_ruby/3.3.0/x86_64-linux:/home/runner/.qlty/cache/tools/ruby/3.3.0-bbe397d161fc/lib/ruby/site_ruby:/home/runner/.qlty/cache/tools/ruby/3.3.0-bbe397d161fc/lib/ruby/vendor_ruby/3.3.0:/home/runner/.qlty/cache/tools/ruby/3.3.0-bbe397d161fc/lib/ruby/vendor_ruby/3.3.0/x86_64-linux:/home/runner/.qlty/cache/tools/ruby/3.3.0-bbe397d161fc/lib/ruby/vendor_ruby:/home/runner/.qlty/cache/tools/ruby/3.3.0-bbe397d161fc/lib/ruby/3.3.0:/home/runner/.qlty/cache/tools/ruby/3.3.0-bbe397d161fc/lib/ruby/3.3.0/x86_64-linux:/home/runner/.qlty/cache/tools/ruby/3.3.0-bbe397d161fc/lib/ruby/"} 2025-01-22T18:03:20Z ERROR [T13] qlty_check::tool (47.8 MB): Failed to set up reek@Some("6.3.0"): Failed to get version for package "reek": (command sh -c "reek --version" exited with code 1) 2025-01-22T18:03:20Z ERROR [T1] qlty (8.7 MB): Command failed: qlty build ❌ Error installing reek@6.3.0. ``` Initially this was very confusing since there were no CLI upgrades between when it was working and when it suddenly stopped working ... In digging into it, we discovered that: - the reek gem [depends on dry-schema](https://github.com/troessner/reek/blob/master/reek.gemspec#L35) - dry-schema [depends on dry-types](https://github.com/dry-rb/dry-schema/blob/main/dry-schema.gemspec#L44) version `~1.8` - dry-types recently [upgraded to 1.8.1 from 1.8.0](https://github.com/dry-rb/dry-types/releases/tag/v1.8.1) Because of the dependency chain, this upgrade was picked up and changed the behavior of the plugin. The upgrade apparently [exposed a bug](https://bugs.ruby-lang.org/issues/20090) in Ruby 3.3.0 that it previously hadn't run into. (h/t dry-rb/dry-system#284 (comment)). This PR bumps the version of ruby to the latest on the 3.3.x line (`3.3.7`). However, I'm currently unable to install this locally via qlty and cannot verify that it does indeed fix the bug. `Reek` runs tests on 3.3.6, so that is also a fairly safe alternative (bug also does not install locally for me). --------- Co-authored-by: Loren Segal <loren@codeclimate.com> Co-authored-by: Loren Segal <lsegal@soen.ca>
FYI I've pushed 1.2.2 that has a compatible syntax |
Describe the bug
When running in AWS Lambda (Local), this error is raised, but the local test
bundle exec cucumber
works correctly.To Reproduce
Source Code:
https://github.com/elct9620/blog-notifier/tree/dbb704d7b5714eb5d9c6878e642f1ace989ac611
Run this shortcut to reproduce it
The full error message output is
Expected behavior
The Lambda Function should execute correctly with feed list.
My environment
The text was updated successfully, but these errors were encountered: