1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/.rubocop.yml

126 lines
2.9 KiB
YAML
Raw Normal View History

AllCops:
TargetRubyVersion: 2.3
# RuboCop has a bunch of cops enabled by default. This setting tells RuboCop
# to ignore them, so only the ones explicitly set in this file are enabled.
DisabledByDefault: true
Exclude:
- '**/templates/**/*'
- '**/vendor/**/*'
- 'actionpack/lib/action_dispatch/journey/parser.rb'
# Align `when` with `case`.
2017-07-22 00:14:46 -04:00
Layout/CaseIndentation:
Enabled: true
# Align comments with method definitions.
2017-07-22 00:14:46 -04:00
Layout/CommentIndentation:
Enabled: true
# No extra empty lines.
2017-07-22 00:14:46 -04:00
Layout/EmptyLines:
Enabled: false
# In a regular class definition, no empty lines around the body.
2017-07-22 00:14:46 -04:00
Layout/EmptyLinesAroundClassBody:
Enabled: true
# In a regular method definition, no empty lines around the body.
2017-07-22 00:14:46 -04:00
Layout/EmptyLinesAroundMethodBody:
Enabled: true
# In a regular module definition, no empty lines around the body.
2017-07-22 00:14:46 -04:00
Layout/EmptyLinesAroundModuleBody:
Enabled: true
# Method definitions after `private` or `protected` isolated calls need one
# extra level of indentation.
2017-07-22 00:14:46 -04:00
Layout/IndentationConsistency:
Enabled: true
EnforcedStyle: rails
# Two spaces, no tabs (for indentation).
2017-07-22 00:14:46 -04:00
Layout/IndentationWidth:
Enabled: true
2017-07-22 00:14:46 -04:00
Layout/SpaceAfterColon:
Enabled: true
2017-07-22 00:14:46 -04:00
Layout/SpaceAfterComma:
Enabled: true
2017-07-22 00:14:46 -04:00
Layout/SpaceAroundEqualsInParameterDefault:
Enabled: true
2017-07-22 00:14:46 -04:00
Layout/SpaceAroundKeyword:
Enabled: true
2017-07-22 00:14:46 -04:00
Layout/SpaceAroundOperators:
Enabled: true
2017-07-22 00:14:46 -04:00
Layout/SpaceBeforeFirstArg:
Enabled: true
# Use `foo {}` not `foo{}`.
2017-07-22 00:14:46 -04:00
Layout/SpaceBeforeBlockBraces:
Enabled: true
# Use `foo { bar }` not `foo {bar}`.
2017-07-22 00:14:46 -04:00
Layout/SpaceInsideBlockBraces:
Enabled: true
# Use `{ a: 1 }` not `{a:1}`.
2017-07-22 00:14:46 -04:00
Layout/SpaceInsideHashLiteralBraces:
Enabled: true
2017-07-22 00:14:46 -04:00
Layout/SpaceInsideParens:
Enabled: true
# Detect hard tabs, no hard tabs.
2017-07-22 00:14:46 -04:00
Layout/Tab:
Enabled: true
# Blank lines should not have any spaces.
2017-07-22 00:14:46 -04:00
Layout/TrailingBlankLines:
Enabled: true
# No trailing whitespace.
2017-07-22 00:14:46 -04:00
Layout/TrailingWhitespace:
Enabled: true
2017-07-22 00:14:46 -04:00
# Prefer &&/|| over and/or.
Style/AndOr:
Enabled: true
# Do not use braces for hash literals when they are the last argument of a
# method call.
Style/BracesAroundHashParameters:
Enabled: true
EnforcedStyle: context_dependent
# Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }.
Style/HashSyntax:
Enabled: true
# Defining a method with parameters needs parentheses.
Style/MethodDefParentheses:
Enabled: true
# Check quotes usage according to lint rule below.
Style/StringLiterals:
Enabled: true
EnforcedStyle: double_quotes
# Use quotes for string literals when they are enough.
Style/UnneededPercentQ:
Enabled: true
# Align `end` with the matching keyword or starting expression except for
# assignments, where it should be aligned with the LHS.
Lint/EndAlignment:
Enabled: true
EnforcedStyleAlignWith: variable
# Use my_method(my_arg) not my_method( my_arg ) or my_method my_arg.
Lint/RequireParentheses:
Enabled: true