Skip to content

Conversation

@etagwerker
Copy link
Collaborator

@etagwerker etagwerker commented Dec 26, 2025

Hi there,

This is the start of a branch to add support for Ruby 4.0. It fixes #555 (reported by @faisal)

The only failure I'm getting locally is this one:

Fabulous run in 4.031929s, 40.6753 runs/s, 70.9338 assertions/s.

  1) Error:
RubyCritic::Generator::JsonReport::#generate_report#test_0001_creates a report file with JSON data inside:
NoMethodError: undefined method 'path' for an instance of FakeFS::Pathname
    /Users/etagwerker/.rbenv/versions/4.0.0/lib/ruby/gems/4.0.0/gems/reek-6.5.0/lib/reek/configuration/app_configuration.rb:70:in 'Pathname#=='
    /Users/etagwerker/.rbenv/versions/4.0.0/lib/ruby/gems/4.0.0/gems/reek-6.5.0/lib/reek/configuration/app_configuration.rb:70:in 'Array#include?'
    /Users/etagwerker/.rbenv/versions/4.0.0/lib/ruby/gems/4.0.0/gems/reek-6.5.0/lib/reek/configuration/app_configuration.rb:70:in 'Reek::Configuration::AppConfiguration#path_excluded?'
    lib/rubycritic/analysers/smells/reek.rb:15:in 'block in RubyCritic::Analyser::ReekSmells#initialize'
    lib/rubycritic/core/analysed_modules_collection.rb:32:in 'Array#each'
    lib/rubycritic/core/analysed_modules_collection.rb:32:in 'RubyCritic::AnalysedModulesCollection#each'
    lib/rubycritic/analysers/smells/reek.rb:13:in 'Enumerable#reject'
    lib/rubycritic/analysers/smells/reek.rb:13:in 'RubyCritic::Analyser::ReekSmells#initialize'
    lib/rubycritic/analysers_runner.rb:30:in 'block in RubyCritic::AnalysersRunner#run'
    lib/rubycritic/analysers_runner.rb:29:in 'Array#each'
    lib/rubycritic/analysers_runner.rb:29:in 'RubyCritic::AnalysersRunner#run'
    test/lib/rubycritic/generators/json_report_test.rb:32:in 'create_analysed_modules_collection'
    test/lib/rubycritic/generators/json_report_test.rb:19:in 'block (3 levels) in <top (required)>'

164 runs, 286 assertions, 0 failures, 1 errors, 0 skips
rake aborted!

Check list:

@faisal
Copy link
Contributor

faisal commented Dec 28, 2025

One more fix, this time to get rid of the warnings about requiring CGI: #559

@faisal
Copy link
Contributor

faisal commented Dec 30, 2025

Starting over(ish)?

@faisal
Copy link
Contributor

faisal commented Dec 30, 2025

Starting over(ish)?

FWIW this branch has all the prior fixes, plus a fix to suppress the path override warning: https://github.com/faisal/rubycritic/tree/restore_4_fixes

It passes all the test and feature tasks, and only shows these warnings when testing:

$ bundle exec rake test
/Users/faisal/Documents/Versioned/rubycritic/.bundle/ruby/3.2.0/gems/flay-2.14.1/lib/flay.rb:11: warning: already initialized constant NotRubyParser
/Users/faisal/Documents/Versioned/rubycritic/.bundle/ruby/3.2.0/gems/flog-4.9.1/lib/flog.rb:7: warning: previous definition of NotRubyParser was here

@etagwerker
Copy link
Collaborator Author

Starting over(ish)?

@faisal Pretty sure I messed up a git merge/rebase and that's why it looked like I was starting over.

https://github.com/faisal/rubycritic/tree/restore_4_fixes

Thanks for pointing me to this branch. I believe it should be good to go now.

Please check it out and let me know if I missed anything. 🙏🏻

@faisal
Copy link
Contributor

faisal commented Dec 30, 2025

Starting over(ish)?

@faisal Pretty sure I messed up a git merge/rebase and that's why it looked like I was starting over.

I had that feeling.

https://github.com/faisal/rubycritic/tree/restore_4_fixes

Thanks for pointing me to this branch. I believe it should be good to go now.

Great -- I'm glad it helped!

Please check it out and let me know if I missed anything. 🙏🏻

It passed all my tests locally, and diffs with results from prior versions showed the output to be substantially the same. I think this is good to go.

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.

Ruby 4 support

3 participants