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

Fix Style/CaseLikeIf cop #11047

Merged
merged 1 commit into from
Jul 18, 2024
Merged

Conversation

archanaserver
Copy link
Contributor

What are the changes introduced in this pull request?

Based on #11009
Addresses the Style/CaseLikeIf rule by converting if-elsif statements to case-when statements

Considerations taken when implementing this change?

Ensured that all if-elsif statements were appropriately converted to case-when.
Make sure of existing logic and functionality of the code during the conversion.

What are the testing steps for this pull request?

We can run the test to ensure that no functionality is broken and all tests pass.

Copy link
Contributor

@m-bucher m-bucher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good to me.

Comment on lines 139 to 140
name = name.downcase
if name =~ /red\s*hat/
case name
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could simplify this to case name.downcase now.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. Thanks

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@m-bucher i've updated the changes, can you take a look?

I've used --autocorrect flag to fix this cop
@ianballou ianballou merged commit 795c90e into Katello:master Jul 18, 2024
25 of 28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants