I highly recommend anyone that uses Ruby uses rubocop… it’s an excellent aid.
Start with the Lint and Performance cops and slowly add in the stylistic ones that you care about.
It’s autocorrect feature is fantastic as well.
Hint: Clean up one cop per commit
Rubocop is kind of neat, but I’ve seen more ‘bug caused by bringing a codebase into compliance with new rules’ than ‘bugs that would’ve been prevented by obeying a cop’, which makes me a little wary.
Certainly seen a bunch of bugs fixed by the Lint cops, I’m less fond of the Style cops.
rubocop is nice, but I find that relaxed.style is unfortunately necessary.
Recently I’ve been working with people coming from other languages to Ruby and I was surprised how useful they found having Rubocop enabled on a project and, also, reek.
The way I use it is somewhat similar to the relaxed style already mentioned here, meaning that I define a set of rules in .rubocop.yml and we have no .rubocop_todo.yml. I found it’s very helpful for new developers coming into a project to see an offence (thanks to the IDE/editor they are using) and get their first commit by writing a small refactor.
I’ve been using standardrb in place of plain Rubocop and it feels like a better set of defaults. Folks who don’t find Rubocop to fit quite right might to give it a shot.