-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 #1566
Upgrade rubocop #1566
Conversation
Ignore rubocop for that specific line And added comments to explain why.
This reverts commit 9203b24.
We actually do not support ruby 2.3 anymore
Rubocop has been bumped to the latest version, and offenses have been fixed. To review this PR, I think it would be easier to look at the commits rather than the diff. @luke-hill What do you think? I removed all inline magic comment I had added before except for one that I have documented. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So yeh reviewing this was hell! Please don't give me a PR with 158 things again to review 😓
We should use the todo file to partially fix things up and then just click them off in the todo file.
Co-authored-by: Luke Hill <[email protected]>
Yeah, sorry for that 😓 I'll summarize all your comments and plan some specific actions. |
Co-authored-by: Luke Hill <[email protected]>
So, to summarize: What we could do as part of dedicated PR (I would open dedicated issues to make sure we do not forget those):
To merge the current PR:
Did I missed something? Does that look like a plan? |
Yep sounds great. I've attached a couple of additional comments where needed. |
The initializer of Core::Event already generates sub-classes with attribute readers. Refs. https://github.com/cucumber/cucumber-ruby-core/blob/main/lib/cucumber/core/event.rb
Actually, So in derived classes as StepDefinitionRegistered or StepActivated, writing an initializer to initialize the attribute readers is doing what already does the base class. Calling Removing the initializer is removing duplicated code. And this is actually covered with tests: when not properly initializing attribute readers for those two classes, some tests broke. |
I have restored the deleted methods. There purpose is actually documentation. |
@luke-hill I guess I answer all your questions. Can we merge? |
Description
Rubocop is fixed to a pretty old version.
The purpose of this PR is to try upgrading it step by step.
Type of change
Please delete options that are not relevant.
Note to other contributors
One of the first offense to be fixed with a new version is done in
lib/cucumber/glue/dsl.rb
. Before we just had theextend(Cucumber::Glue::Dsl)
instruction to extend the global Object class. This triggered an offense. I've fixed it by explicitly replacing it with the following:That way the extension of the global Object class is made explicit. Tests seems to be passing. Does that looks good to advanced ruby developers?
Checklist:
Your PR is ready for review once the following checklist is
complete. You can also add some checks if you want to.
bundle exec rubocop
reports no offenses