A disciplined method to fix Rubocop TODOs

Here, a listicle of advice you never asked for!

A method to locate and fix linting errors in Rubocop one at a time:

  • choose a “cop” from the .rubocop_todo.yml file
  • remove the line which includes the .rubocop_todo.yml
  • rubocop --only Lint/IneffectiveAccessModifier
  • fix issues and test fixes with the --only invocation
  • rubocop --auto-gen-config to regenerate the .rubocop_todo.yml file
  • git checkout .rubocop.yml to add back include line
  • commit this change with the name of the “cop” used

I really really tried to use it at FakeFS.

Published by Olle Jonsson

Human. Wears glasses and often a smile.

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.