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 Rubocop TrailingCommaInLiteral issue at UI build #17327

Conversation

saulotoledo
Copy link
Member

@saulotoledo saulotoledo commented Apr 22, 2018

At version0.53.0, the TrailingCommaInLiteral rule at Rubocop has been split intoTrailingCommaInHashLiteral and TrailingCommaInArrayLiteral and no longer exists. The current version definition for Rubocop allow us to use the version 0.52.1 or superior, but it is not possible to have both versions by having that options in your rubocop.yml file.

In order to use the new updated rules, this PR updates the current rubocop version to 0.53.0.

@miq-bot miq-bot requested a review from agrare April 22, 2018 20:54
@saulotoledo saulotoledo changed the title Fix Rubocop TrailingCommaInLiteral issues at UI build Fix Rubocop TrailingCommaInLiteral issue at UI build Apr 22, 2018
@saulotoledo
Copy link
Member Author

@miq-bot add_reviewer @agrare

@agrare
Copy link
Member

agrare commented Apr 23, 2018

cc @bdunne

Gemfile Outdated
gem "haml_lint", "~>0.20.0", :require => false
gem "rubocop", "~>0.52.1", :require => false
gem "haml_lint", "~>0.20.0", :require => false
gem "rubocop", ">=0.52.1", "<0.53.0", :require => false
Copy link
Member

Choose a reason for hiding this comment

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

What's wrong with ~>0.52.1?

Copy link
Member Author

@saulotoledo saulotoledo Apr 23, 2018

Choose a reason for hiding this comment

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

@bdunne It will handle the major version only, so 0.x.x. But the breaking change happened at a minor version and we should change only the patch number, 0.52.x.

Copy link
Member Author

Choose a reason for hiding this comment

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

Another solution is to update the config file at guides repo (it is done in my machine, just tell me and I will submit the PR) and use ~>0.53.0 here.

Copy link
Member

Choose a reason for hiding this comment

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

It will handle the major version only, so 0.x.x.

No, ~> only allows the last specified part to float. So with x.y.z, x and y are fixed and z is the minimum.

Copy link
Member Author

Choose a reason for hiding this comment

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

@bdunne Hum... you're right. I read the documentation again and it is exactly as you said. For some reason Scrutinizer is using Rubocop 0.55. I do not have access to that, but I will try to figure out if there is another solution. In the meantime, is it a problem to update the rules to use 0.53.x?

Copy link
Member

Choose a reason for hiding this comment

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

I'm not opposed to updating it as long as the config files and requirements are updated in all of the repos.

Copy link
Member Author

Choose a reason for hiding this comment

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

@bdunne Ok. Give me some time and I will update here and push the merge request at guides repository. On the other hand, according to the Scrutinizer docs the gem at Gemfile should have worked... Anyway, I agree that updating will solve the problem.

@saulotoledo saulotoledo force-pushed the fix_ui_scrutinizer_rubocop_error branch from 131fc20 to 40a33c7 Compare April 23, 2018 21:16
@miq-bot
Copy link
Member

miq-bot commented Apr 23, 2018

Checked commit saulotoledo@40a33c7 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0
1 file checked, 0 offenses detected
Everything looks fine. 🏆

@saulotoledo
Copy link
Member Author

@bdunne, what do you think about the current solution? I updated the configuration at ManageIQ/guides#303 .

@NickLaMuro
Copy link
Member

Is there any reason we can't just make the leap to the latest rubocop, which I think is 0.55.0?

@saulotoledo
Copy link
Member Author

@NickLaMuro I added the version 0.53.0 because is the smaller version number that supports the rules we are using. @bdunne, what do you think about?

@miq-bot
Copy link
Member

miq-bot commented Oct 29, 2018

This pull request has been automatically closed because it has not been updated for at least 6 months.

Feel free to reopen this pull request if these changes are still valid.

Thank you for all your contributions!

@miq-bot miq-bot closed this Oct 29, 2018
@saulotoledo
Copy link
Member Author

@agrare @bdunne I believe we should keep this open. We had related news yesterday at ManageIQ/miq_bot#432

I do not have access here to reopen, but I will try to do it later.

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.

5 participants