flyerhzm / rails_best_practices

a code metric tool for rails projects
http://rails-bestpractices.com
MIT License
4.16k stars 276 forks source link

Ruby 2.7 shows core/check.rb:44: warning: deprecated Object#=~ is called on Array; it always returns nil #353

Closed Fornacula closed 4 years ago

Fornacula commented 4 years ago

Current behaviour: On fresh install of Ruby 2.7.0p0 and Rails 6.0.2.1 when running rails_best_practices . terminal fills with hundreds of similar warnings like the following:

/home/myuser/.rvm/gems/ruby-2.7.0/gems/rails_best_practices-1.19.5/lib/rails_best_practices/core/check.rb:44: warning: deprecated Object#=~ is called on Array; it always returns nil

Expected behaviour: warnings wont get displayed when running rails_best_practices

flyerhzm commented 4 years ago

@Fornacula it's fixed in version 1.20.0

hoshy commented 4 years ago

I still get this error .../.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rails_best_practices-1.20.0/lib/rails_best_practices/core/check.rb:44: warning: deprecated Object#=~ is called on Array; it always returns nil

$ ruby --version
ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-darwin19]
$ bundle exec rails_best_practices --version
1.20.0
AlecRust commented 4 years ago

I also get this in gem version 1.20.0 with Ruby 2.7.1. Is it fixed by #370?

flyerhzm commented 4 years ago

@AlecRust yes, I think so, I can't see this warning anymore.

Backbone81 commented 4 years ago

@flyerhzm This issue is fixed in master (https://github.com/flyerhzm/rails_best_practices/blob/master/lib/rails_best_practices/reviews/remove_unused_methods_in_helpers_review.rb#L23) but not in v1.20.0 (https://github.com/flyerhzm/rails_best_practices/blob/v1.20.0/lib/rails_best_practices/reviews/remove_unused_methods_in_helpers_review.rb#L23). v1.20.0 was created on 29.02.2020 but the fix was merged into master on 29.03.2020. Please create a new release to fix this issue.

DJA89 commented 3 years ago

Is it possible to get this fix using this gem? What I mean is telling bundler to bring the gem at that specific commit. If it's possible, is it safe? I've never done this before