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

Renew RuboCop effort based on StandardRB #935

Merged
merged 4 commits into from
May 3, 2021
Merged

Conversation

solebared
Copy link
Collaborator

@solebared solebared commented Apr 14, 2021

Why

Back in October, @smoline put in some great work introducing rubocop into our codebase.
Sadly, we had to prioritize feature development and weren't able to complete and merge all that work.
This is the first of several PRs intended to revive that effort.

Since then, StandardRB has hit v1.0 and i think there's a lot to gain from basing our rules on theirs. Primarily, they've done a lot of work to weigh different alternative options and tried to standardize, which means we have less to think about!

That said, StandardRB is an inherently 'opinionated' tool and (not surprisingly 😏), i would like a little more flexibility than it allows.

As such, i'm proposing that we base our rules on StandardRB but retain the ability to customize on top of them.

What

In this PR:

  • Replace our fledgling .rubocop.yml config with one that inherits from StandardRB, via the standard gem.
  • Generate a .rubocop_todo.yml which encapsulates and excludes all existing violations. This allows us to enable linting of new code without having to first fix the whole codebase. It also sets up follow-on PRs to fix violations; see Next Steps below.
  • Cherry pick @smoline's 62ce3a0, which adds rubocop to our CircleCI build 💥🙏🏾

See Next Steps for a list of follow-up PRs that customize the ruleset and incrementally address existing violations.

How

The integration with StandardRB is based on this evilmartians.com article.

The idea is to continue using rubocop executables instead of standard but simply to base our rubocop config on theirs.

Testing

Adds StandardRB-based rubocop validation to our CI builds.

Next Steps

Outstanding Questions, Concerns and Other Notes

Would love to hear opinions about this approach of:

  1. basing our ruleset on StandardRB, and
  2. allowing for our own customizations (which, to be clear, is something StandardRB does not recommend).

Meta

Huge shoutout to @smoline for laying the groundwork for all this. Sorry we couldn't merge your PRs as-is, but we're very much indebted to that foundation!

Pre-Merge Checklist

  • Security & accessibility have been considered
  • Tests have been added, or an explanation has been given why the features cannot be tested
  • Documentation and comments have been added to the codebase where required
  • Entry added to CHANGELOG.md if appropriate
  • Outstanding questions and concerns have been resolved
  • Any next steps have been turned into Issues or Discussions as appropriate

@solebared solebared changed the title Renew Rubocop effort based on StandardRB Renew RuboCop effort based on StandardRB Apr 15, 2021
@maebeale
Copy link
Collaborator

Cool idea!

@maebeale
Copy link
Collaborator

YES, omg, @smoline, we've been trying to figure out how to merge all that amazing work for a while now. THANK YOU for taking on such a huge task and driving the investment in linting!!!!!

@maebeale
Copy link
Collaborator

I do think this should make it in to changelog developer notes.

@solebared
Copy link
Collaborator Author

@maebeale, @h-m-m, @svileshina : we chatted a bit about this last night and i think i heard general agreement.

But we also ran out of time so i'd love explicit approval about this general approach before merging. I also likely won't be around tuesday morning, so if you can give it some consideration and post any thoughts, that would be great.

Could also be useful to look over a few of the follow up PRs listed under next steps above. We can review them fully over time, but they'll help paint a fuller picture of what the path towards full integration would look like.

@solebared
Copy link
Collaborator Author

Discussed and approved in person.

@solebared solebared merged commit 9fd9a11 into main May 3, 2021
@solebared solebared deleted the rubocop/standard-rb branch May 3, 2021 17:30
@solebared solebared mentioned this pull request May 3, 2021
8 tasks
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.

3 participants