Skip to content

Instantly share code, notes, and snippets.

@mjhennig
Last active June 27, 2018 12:29
Show Gist options
  • Select an option

  • Save mjhennig/aa2c12005252b17da828e3a593423086 to your computer and use it in GitHub Desktop.

Select an option

Save mjhennig/aa2c12005252b17da828e3a593423086 to your computer and use it in GitHub Desktop.
RuboCop configuration example
# This is a configuration file for RuboCop, a static code analyzer for the
# Ruby programming language, adjusting its behavior to reflect the syle guide
# of some eyeo Ruby projects. Refer to https://github.com/bbatsov/rubocop and
# https://github.com/bbatsov/rubocop/blob/master/manual/configuration.md for
# more information on the RuboCop software and configuration.
---
# Metics/BlockLength has been disabled due to nested RSpec describe blocks
# easily exceeding any limit one may consider reasonable in "regular" code.
# Note that authors are encouraged to keep block length short nonetheless.
BlockLength:
Enabled: false
# Sometimes braces around hash parameters can be quite useful to improve code
# readability, especially when dealing with long parameter lists.
BracesAroundHashParameters:
Enabled: false
# Compact denotation of nested Module::Children allows for a straightforward
# documentation style and unified indentation levels, but nested is required
# to not perform too many stunts when declaring modules.
ClassAndModuleChildren:
Enabled: false
# Additional empty lines around bodies are required when the content includes
# more nested bodies, but one may avoid them in simple structures that - most
# likely - will never become extended by further complexity.
EmptyLinesAroundClassBody:
Enabled: false
EmptyLinesAroundBlockBody:
Enabled: false
EmptyLinesAroundMethodBody:
Enabled: false
EmptyLinesAroundModuleBody:
Enabled: false
# Methods should be kept short, though that is not a very sophisticated metric.
# Either way, methods exceeding the amount of lines on traditional terminal are
# worth avoiding for the sake of easier development and maintenance.
MethodLength:
Max: 40
# Explicit return statements are explicitly requested wherever possible, in
# order to indicate a method actually intending to return a value, rather than
# implicitly exposing the result of the last operation.
RedundantReturn:
Enabled: false
# Trailing commas in multi-line lists avoid the need to change an unrelated
# line when developing patch-sets that modify the associated source-code.
TrailingCommaInArguments:
EnforcedStyleForMultiline: "comma"
TrailingCommaInLiteral:
EnforcedStyleForMultiline: "comma"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment