-
Notifications
You must be signed in to change notification settings - Fork 898
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
Apply rubocop fixes to RoleManagement #20881
Conversation
@jrafanie Look ok? |
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.
Sorry, for the slow review. I'm mostly good with the changes. A few comments are above.
deactivate_roles(r.name) | ||
end unless adds.empty? | ||
adds = ServerRole.where(:name => (desired - current)) | ||
unless adds.empty? |
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.
Interesting...I'm curious why this was in the original code at all... .each
will effectively be a no-op anyway. Not for this PR, but this line can be removed in a follow-up
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.
Noted.
which one is the loop change? |
|
That one seems fine to me...it's a straight syntactical change. |
@djberg96 Can you squash commits? Otherwise the history shows a delete and a re-add which is confusing. |
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.
LGTM - just needs a squash.
lol, I just did that, gimme 2 minutes! ....ok done. |
Checked commit https://github.com/djberg96/manageiq/commit/ef3335109175b35492b09b17dd297c3944f91ec6 with ruby 2.6.3, rubocop 0.82.0, haml-lint 0.35.0, and yamllint app/models/miq_server/role_management.rb
|
This applies all of the rubocop fixes that can be applied via
rubocop -A
to the RoleManagement class. It's a mix of formatting tweaks, usingalias
instead ofalias_method
, removal of redundantself
calls, plus some changes to the way some loops are handled.Of these, I think the loop change might be the only one we might not want, in which case we should update the cop.