You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello. 馃憢 I stumbled across an issue where I can't include Reek as a gem unless RuboCop is also required. I can see that Reek::Report::XMLReport requires rexml/document but there appears to be an order of operation issue where REXML isn't loaded in time.
Steps to Recreate
You can run the following script to reproduce:
#! /usr/bin/env ruby# frozen_string_literal: true# Save as `snippet`, then `chmod 755 snippet`, and run as `./snippet`.require"bundler/inline"gemfiletruedosource"https://rubygems.org"gem"reek"endputs"Failed to make it here. 馃槩"
Upon running ./snippet, I'll get the following output:
Stack Dump
Fetching gem metadata from https://rubygems.org/........
Resolving dependencies...
Using ast 2.4.2
Using bundler 2.4.6
Using kwalify 0.7.2
Using rainbow 3.1.1
Using parser 3.2.0.0
Using reek 6.1.4
<internal:/Users/bkuhlmann/.cache/frum/versions/3.2.0/lib/ruby/site_ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require': cannot load such file -- rexml/document (LoadError)
from <internal:/Users/bkuhlmann/.cache/frum/versions/3.2.0/lib/ruby/site_ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
from /Users/bkuhlmann/.cache/frum/versions/3.2.0/lib/ruby/gems/3.2.0/gems/reek-6.1.4/lib/reek/report/xml_report.rb:13:in `<class:XMLReport>'
from /Users/bkuhlmann/.cache/frum/versions/3.2.0/lib/ruby/gems/3.2.0/gems/reek-6.1.4/lib/reek/report/xml_report.rb:12:in `<module:Report>'
from /Users/bkuhlmann/.cache/frum/versions/3.2.0/lib/ruby/gems/3.2.0/gems/reek-6.1.4/lib/reek/report/xml_report.rb:6:in `<module:Reek>'
from /Users/bkuhlmann/.cache/frum/versions/3.2.0/lib/ruby/gems/3.2.0/gems/reek-6.1.4/lib/reek/report/xml_report.rb:5:in `<top (required)>'
from /Users/bkuhlmann/.cache/frum/versions/3.2.0/lib/ruby/gems/3.2.0/gems/reek-6.1.4/lib/reek/report.rb:6:in `require_relative'
from /Users/bkuhlmann/.cache/frum/versions/3.2.0/lib/ruby/gems/3.2.0/gems/reek-6.1.4/lib/reek/report.rb:6:in `<top (required)>'
from /Users/bkuhlmann/.cache/frum/versions/3.2.0/lib/ruby/gems/3.2.0/gems/reek-6.1.4/lib/reek.rb:8:in `require_relative'
from /Users/bkuhlmann/.cache/frum/versions/3.2.0/lib/ruby/gems/3.2.0/gems/reek-6.1.4/lib/reek.rb:8:in `<top (required)>'
from /Users/bkuhlmann/.cache/frum/versions/3.2.0/lib/ruby/site_ruby/3.2.0/bundler/runtime.rb:60:in `require'
from /Users/bkuhlmann/.cache/frum/versions/3.2.0/lib/ruby/site_ruby/3.2.0/bundler/runtime.rb:60:in `block (2 levels) in require'
from /Users/bkuhlmann/.cache/frum/versions/3.2.0/lib/ruby/site_ruby/3.2.0/bundler/runtime.rb:55:in `each'
from /Users/bkuhlmann/.cache/frum/versions/3.2.0/lib/ruby/site_ruby/3.2.0/bundler/runtime.rb:55:in `block in require'
from /Users/bkuhlmann/.cache/frum/versions/3.2.0/lib/ruby/site_ruby/3.2.0/bundler/runtime.rb:44:in `each'
from /Users/bkuhlmann/.cache/frum/versions/3.2.0/lib/ruby/site_ruby/3.2.0/bundler/runtime.rb:44:in `require'
from /Users/bkuhlmann/.cache/frum/versions/3.2.0/lib/ruby/site_ruby/3.2.0/bundler/inline.rb:66:in `block (2 levels) in gemfile'
from /Users/bkuhlmann/.cache/frum/versions/3.2.0/lib/ruby/site_ruby/3.2.0/bundler/settings.rb:131:in `temporary'
from /Users/bkuhlmann/.cache/frum/versions/3.2.0/lib/ruby/site_ruby/3.2.0/bundler/inline.rb:51:in `block in gemfile'
from /Users/bkuhlmann/.cache/frum/versions/3.2.0/lib/ruby/site_ruby/3.2.0/bundler.rb:418:in `block in with_unbundled_env'
from /Users/bkuhlmann/.cache/frum/versions/3.2.0/lib/ruby/site_ruby/3.2.0/bundler.rb:664:in `with_env'
from /Users/bkuhlmann/.cache/frum/versions/3.2.0/lib/ruby/site_ruby/3.2.0/bundler.rb:418:in `with_unbundled_env'
from /Users/bkuhlmann/.cache/frum/versions/3.2.0/lib/ruby/site_ruby/3.2.0/bundler/inline.rb:42:in `gemfile'
from /Users/bkuhlmann/Engineering/Misc/snippet:8:in `<main>'
Overview
Hello. 馃憢 I stumbled across an issue where I can't include Reek as a gem unless RuboCop is also required. I can see that
Reek::Report::XMLReport
requiresrexml/document
but there appears to be an order of operation issue where REXML isn't loaded in time.Steps to Recreate
You can run the following script to reproduce:
Upon running
./snippet
, I'll get the following output:Stack Dump
Environment
The text was updated successfully, but these errors were encountered: