-
-
Notifications
You must be signed in to change notification settings - Fork 719
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
Fix Rubocop Rails/NegateInclude issues #12337
Fix Rubocop Rails/NegateInclude issues #12337
Conversation
- cop class: RuboCop::Cop::Rails::NegateInclude - replaced !array.include?(2) by array.exclude?(2)
Hello @dacook or @sigmundpetersen , could someone relaunch checks, there is a strange error that do not show up locally. |
Hey @cyrillefr I have run the spec 10 times, consistently failing. |
Really weird this kind of behaviour that arise on my PR (why me :)) |
Yay, looks good @cyrillefr 🎉 |
So, is this luck or what ? Hello @sigmundpetersen , |
Ah, @sigmundpetersen , sorry, did not see your reply. |
I think everything is fine @cyrillefr ! |
checkbox_id = "order_cycle_incoming_exchange_0_select_all_variants" | ||
page.execute_script("document.getElementById('#{checkbox_id}').scrollIntoView()") | ||
elmnt = find_field(id: checkbox_id) | ||
scroll_to(elmnt, align: :top) |
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.
- That's great to incorporate the latest recommended method.
- By looking at the flaky spec, we are not getting the element by
checkbox_id
- Like the proposed changes, I think it's worth trying to use the built-in capybara method as opposed to running the JS script for the purpose
- Let's hope for the best now :)
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.
Great work! 🎉
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.
Nice one, thanks @cyrillefr 🙏
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.
Great, thanks!
I have seen problematic corrections of this cop in the past because it can't know the type of object at run time but these fixes seem all good. 👍
I think that we can merge this straight away.
What? Why?
Fixes one of many rubocop issues
!array.include?(2)
witharray.exclude?(2)
.rubocop_todo.yml
updatedWhat should we test?
Nothing: the rubocop should raise no offenses when checking linters at Integration.
Release notes
Changelog Category (reviewers may add a label for the release notes):
The title of the pull request will be included in the release notes.
Dependencies
Documentation updates