slack-ruby / slack-ruby-bot-server

A library that enables you to write a complete Slack bot service with Slack button integration, in Ruby.
MIT License
268 stars 74 forks source link

Upgrade rubocop to v1.47 #165

Closed crazyoptimist closed 1 year ago

crazyoptimist commented 1 year ago

TargetRubyVersion in Rubocop config is the oldest officially supported Ruby version(currently 2.6).

crazyoptimist commented 1 year ago

It's soooo weird that rubocop passes on my machine, with the exactly same ruby version with the ci.

❯ ruby --version
ruby 3.1.3p185 (2022-11-24 revision 1a6b16756e) [x86_64-linux]

bundle exec rake rubocop result:

Inspecting 67 files
...................................................................

67 files inspected, no offenses detected

But 2 offences are detected in the ci and it doesn't pass.

🤔

dblock commented 1 year ago

Your local is probably not running the same version of Rubocop. Enable all cops (AllCops/Enabled: true) and then run bundle exec rubocop -a ; bundle exec rubocop --auto-gen-config.

crazyoptimist commented 1 year ago

It turns out that TargetRubyVersion should be set in the rubocop config. Now I set it to 3.1 and it passes, but do you see any problem in doing so? @dblock

crazyoptimist commented 1 year ago

Actually need to revert the rubocop run, because it broke some working code. Working on it.

crazyoptimist commented 1 year ago

So let me know if running rubocop on ruby 3.1 may have any problem. I'm not sure.

dblock commented 1 year ago

So let me know if running rubocop on ruby 3.1 may have any problem. I'm not sure.

Yeah you should be targeting the minimum version of Ruby we support, which is 2.6 I believe looking at CI, otherwise it might generate code that doesn’t work.

crazyoptimist commented 1 year ago

Got it. I'll do.

dangerpr-bot commented 1 year ago
1 Message
:book: We really appreciate pull requests that demonstrate issues, even without a fix. That said, the next step is to try and fix the failing tests!

Generated by :no_entry_sign: Danger

crazyoptimist commented 1 year ago

So let me know if running rubocop on ruby 3.1 may have any problem. I'm not sure.

Yeah you should be targeting the minimum version of Ruby we support, which is 2.6 I believe looking at CI, otherwise it might generate code that doesn’t work.

Done. @dblock