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

Use Ruby style guide from Shopify #1

Open
wants to merge 2 commits into
base: shopify-style
Choose a base branch
from

Conversation

ulandj
Copy link

@ulandj ulandj commented Jan 28, 2021

* Add rubocop-shopify
* Add rubocop-rails
* Add rubocop-rspec
* Add rubocop-performance
@ulandj ulandj requested a review from calvinhughes January 28, 2021 07:15
@nattfodd
Copy link
Contributor

nattfodd commented Jan 28, 2021

Hey! The idea behind this gem was not only to unify style across Veeqo ruby projects, but also establish agreement on every cop added here among Veeqo developers. We used to have votes on every single rule, because normally we have different opinions on cops. For instance, for historical reasons several developers are irritated by some false-positives fired by Rubocop or simply disagree that any cop should dictate style (i.e. double-qoutes vs single-quotes). So we skip controversial ones.

Another reason, why taking a set of rules would not be correct is that it blocks most of the repos from upgrade to this new version - because of many not fixed violations. We would need to generate another large rubocop-todo.yml file that by its nature disables those rules in entire files making rubocop much less effective.

And the last one, is that unlinke Hound, Rubocop is now mandatory step of pipeline. So adding many rules at once makes it more likely to fail.

TLDR:

  • we have to discuss every new rule with the whole engineering team (#rubocop-veeqo slack channel) to make everyone happy living with it, and add them thoughtfully one by one
  • adding rules one by one allows us to fix them in the repos, so that to the moment of gem upgrade the repo has no offences against this new cop

@ulandj
Copy link
Author

ulandj commented Jan 29, 2021

Hey @nattfodd, thanks for the comment!
Yeah, I'm aware of all that you described. It is applicable for the Veeqo app where a lot of old code styles and devs contribute to it. Therefore it's really problematic to apply a bunch of new rules and come to the final solution. I completely agree with the solution where we ask for everyone's thoughts to apply new rules and decide by voting. But seems like it will take much time to complete applying all of the rules while other our already existent and upcoming integration services' apps like etsy-integratino, vend-integration and etc. need unifying code styles. And where engineers who deal with these apps are not many(4-5 of us) and the code base is not so big. That's why we(Channels Team) think that it's better to use already polished by communities Ruby code style and unify codes of all integration services' apps. For this, we decided to use this repo but a different branch to avoid duplicated gem installations in every app.
Does it make sense?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants