Using RuboCop
When you write Ruby code, you often don’t want to have to think about style. What you want to do is write your code and solve your problem. But what usually happens is that once you have your team review your code, people on your team start to nitpick your minor style choices, sometimes contradicting each other. This is, to say the least, not compatible with great team morale.
Enter RuboCop.[43] RuboCop is a linter, which means that it automatically checks your code for style and then either flags discrepancies or optionally autocorrects them. (The name “linter” comes from the first such program, lint, written in 1978 by Stephen C. Johnson for C code and named by analogy to a lint trap as a thing that catches small issues.)
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access