Version 2.3

A more liberal style guide for RuboCop. It comes
with a config file that deactivates some of
RuboCop's features. It is meant as a less restrictive foundation that you can use
directly or base your style discussions on.

Motivation

RuboCop is an amazing tool, still some of its default rules feel overly strict. This
might distract you from the helpful messages.

Warning: Does include opinionated style advice.

How to Read this Style Guide

This is not a stand-alone style guide, but a patch applied to
bbatsov/ruby-style-guide
(the style guide RuboCop is based on).

Usage

Use, copy or inherit from rubocop.yml.
One way is to add the following lines to your .rubocop.yml:

Style/MultilineBlockChain

Style/NegatedIf

Disabled rule. Always
use if !condition for complex conditions with negations. For simple conditions, for
which it also unlikely that an else clause will be added at some later point, it is also
OK to use unless condition.

Style/NegatedWhile

Disabled rule. Always
use while !condition for complex conditions with negations. For simple conditions,
it is also OK to use until condition.

Style/ParallelAssignment

Disabled rule.
Parallel assignment can sometimes express the intented logic better than sequential
assignment. It is also faster.

Style/PercentLiteralDelimiters

Disabled rule. When
creating literals with the % syntax, choose any delimiters that don't interfere with
the literal's content.

Style/PerlBackrefs

Disabled rule.
It is fine to use the special local variables $1 - $9 to access the contents of
your last matched regex groups.

Style/WordArray

Word arrays using the percent syntax
make for a good and concise way to create an array of strings, especially if creating lots
of strings. However, it it should be considered a good option, instead of being mandatory
to use.

Style/WhileUntilModifier

Disabled rule. Use or
don't use while/until in modifier style whenever you think it improves code
readability.

Lint/AmbiguousRegexpLiteral

Use regex normally.

Lint/AssignmentInCondition

Disabled rule.
Use = for assignments in conditions. Use == for comparisons in conditions.

Metrics

RuboCop's code complexity metrics can be very useful indications, however, they should
be discussed, tweaked and activated individually.