Using Standard
RuboCop is powerful, but also complicated. If we’re being honest, we don’t like all the defaults. As a result, our typical project winds up with a long configuration file that’s a bit unwieldy and continually subject to argument. If only somebody would come up with a more consensus-based Ruby style-checker.
Enter Standard,[46] a default configuration of RuboCop created by Justin Searls that is minimally configurable and conforms to a small, but commonly used, set of rules.
What rules? You can see the entire list in the Standard RuboCop’s setup, but the gist is similar to the common rules we set out in the first part of this chapter:
- Two-space indentation
- Double-quoted strings
- No hash rockets for symbol hash keys
- Spaces inside ...
Get Programming Ruby 3.3 now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.