Skip to content
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

Upgrade rubocop to v1.47 #165

Merged

Conversation

crazyoptimist
Copy link
Collaborator

@crazyoptimist crazyoptimist commented Mar 2, 2023

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

@crazyoptimist crazyoptimist force-pushed the chore/upgrade-rubocop-march-2023 branch from 5c8bab7 to 3939223 Compare March 2, 2023 21:42
@crazyoptimist
Copy link
Collaborator Author

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
Copy link
Collaborator

dblock commented Mar 2, 2023

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
Copy link
Collaborator Author

crazyoptimist commented Mar 3, 2023

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
Copy link
Collaborator Author

crazyoptimist commented Mar 3, 2023

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

@crazyoptimist crazyoptimist force-pushed the chore/upgrade-rubocop-march-2023 branch from 8800794 to 78582ee Compare March 3, 2023 17:57
@crazyoptimist
Copy link
Collaborator Author

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

@dblock
Copy link
Collaborator

dblock commented Mar 3, 2023

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
Copy link
Collaborator Author

Got it. I'll do.

@dangerpr-bot
Copy link

1 Message
📖 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 🚫 Danger

@crazyoptimist
Copy link
Collaborator Author

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

@crazyoptimist crazyoptimist force-pushed the chore/upgrade-rubocop-march-2023 branch from e0246bf to d696a72 Compare March 6, 2023 06:46
@dblock dblock merged commit 5560369 into slack-ruby:master Mar 6, 2023
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.

None yet

3 participants