Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
158 changes: 79 additions & 79 deletions rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,6 @@ AllCops:
Exclude:
- "data/**/*"

Performance:
Exclude:
- "test/**/*"

# Prefer assert_not over assert !
Rails/AssertNot:
Include:
- "test/**/*"

# Prefer assert_not_x over refute_x
Rails/RefuteMethods:
Include:
- "test/**/*"

# We generally prefer &&/|| but like low-precedence and/or in context
Style/AndOr:
Enabled: false

# Align `when` with `end`.
Layout/CaseIndentation:
Enabled: true
Expand All @@ -43,13 +25,6 @@ Layout/CommentIndentation:
Layout/ElseAlignment:
Enabled: true

# Align `end` with the matching keyword or starting expression except for
# assignments, where it should be aligned with the LHS.
Layout/EndAlignment:
Enabled: true
EnforcedStyleAlignWith: variable
AutoCorrect: true

Layout/EmptyLineAfterMagicComment:
Enabled: true

Expand All @@ -68,10 +43,12 @@ Layout/EmptyLinesAroundMethodBody:
Layout/EmptyLinesAroundModuleBody:
Enabled: true

# Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }.
Style/HashSyntax:
# Align `end` with the matching keyword or starting expression except for
# assignments, where it should be aligned with the LHS.
Layout/EndAlignment:
Enabled: true
EnforcedShorthandSyntax: either
EnforcedStyleAlignWith: variable
AutoCorrect: true

# Method definitions after `private` or `protected` isolated calls need one
# extra level of indentation.
Expand All @@ -82,6 +59,10 @@ Layout/IndentationConsistency:
Enabled: false
EnforcedStyle: indented_internal_methods

# Detect hard tabs, no hard tabs.
Layout/IndentationStyle:
Enabled: true

# Two spaces, no tabs (for indentation).
#
# Doesn't behave properly with private-only concerns, so it's disabled.
Expand All @@ -103,36 +84,20 @@ Layout/SpaceAroundEqualsInParameterDefault:
Layout/SpaceAroundKeyword:
Enabled: true

Layout/SpaceBeforeComma:
Enabled: true

Layout/SpaceBeforeFirstArg:
Enabled: true

Style/DefWithParentheses:
# Use `foo {}` not `foo{}`.
Layout/SpaceBeforeBlockBraces:
Enabled: true

# Defining a method with parameters needs parentheses.
Style/MethodDefParentheses:
Layout/SpaceBeforeComma:
Enabled: true

# Use `foo {}` not `foo{}`.
Layout/SpaceBeforeBlockBraces:
Layout/SpaceBeforeFirstArg:
Enabled: true

# Use `->(x, y) { x + y }` not `-> (x, y) { x + y }`
Layout/SpaceInLambdaLiteral:
Enabled: true

Style/StabbyLambdaParentheses:
Enabled: true

# Use `foo { bar }` not `foo {bar}`.
# Use `foo { }` not `foo {}`.
Layout/SpaceInsideBlockBraces:
Enabled: true
EnforcedStyleForEmptyBraces: space

# Use `[ a, [ b, c ] ]` not `[a, [b, c]]`
# Use `[]` not `[ ]`
Layout/SpaceInsideArrayLiteralBrackets:
Expand All @@ -144,6 +109,12 @@ Layout/SpaceInsideArrayLiteralBrackets:
Layout/SpaceInsideArrayPercentLiteral:
Enabled: true

# Use `foo { bar }` not `foo {bar}`.
# Use `foo { }` not `foo {}`.
Layout/SpaceInsideBlockBraces:
Enabled: true
EnforcedStyleForEmptyBraces: space

# Use `{ a: 1 }` not `{a:1}`.
# Use `{}` not `{ }`.
Layout/SpaceInsideHashLiteralBraces:
Expand All @@ -165,21 +136,6 @@ Layout/SpaceInsidePercentLiteralDelimiters:
Layout/SpaceInsideReferenceBrackets:
Enabled: true

# Use `"foo"` not `'foo'` unless escaping is required
Style/StringLiterals:
Enabled: true
EnforcedStyle: double_quotes
Include:
- "app/**/*"
- "config/**/*"
- "lib/**/*"
- "test/**/*"
- "Gemfile"

# Detect hard tabs, no hard tabs.
Layout/IndentationStyle:
Enabled: true

# Blank lines should not have any spaces.
Layout/TrailingEmptyLines:
Enabled: true
Expand All @@ -188,35 +144,59 @@ Layout/TrailingEmptyLines:
Layout/TrailingWhitespace:
Enabled: true

# Use quotes for string literals when they are enough.
Style/RedundantPercentQ:
Enabled: false
Lint/RedundantStringCoercion:
Enabled: true

# Use my_method(my_arg) not my_method( my_arg ) or my_method my_arg.
Lint/RequireParentheses:
Enabled: true

Lint/RedundantStringCoercion:
Enabled: true

Lint/UriEscapeUnescape:
Enabled: true

Style/ParenthesesAroundCondition:
Enabled: true
Performance:
Exclude:
- "test/**/*"

Style/RedundantReturn:
Performance/FlatMap:
Enabled: true
AllowMultipleReturnValues: true

Style/Semicolon:
Performance/UnfreezeString:
Enabled: true
AllowAsExpressionSeparator: true

# Prefer assert_not over assert !
Rails/AssertNot:
Include:
- "test/**/*"

# Prefer assert_not_x over refute_x
Rails/RefuteMethods:
Include:
- "test/**/*"

# We generally prefer &&/|| but like low-precedence and/or in context
Style/AndOr:
Enabled: false

# Prefer Foo.method over Foo::method
Style/ColonMethodCall:
Enabled: true

Style/DefWithParentheses:
Enabled: true

# Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }.
Style/HashSyntax:
Enabled: true
EnforcedShorthandSyntax: either

# Defining a method with parameters needs parentheses.
Style/MethodDefParentheses:
Enabled: true

Style/ParenthesesAroundCondition:
Enabled: true

Style/PercentLiteralDelimiters:
Enabled: true
PreferredDelimiters:
Expand All @@ -227,14 +207,34 @@ Style/PercentLiteralDelimiters:
"%w": "[]"
"%W": "[]"

Style/TrailingCommaInArrayLiteral:
# Use quotes for string literals when they are enough.
Style/RedundantPercentQ:
Enabled: false

Style/RedundantReturn:
Enabled: true
AllowMultipleReturnValues: true

Style/TrailingCommaInHashLiteral:
Style/Semicolon:
Enabled: true
AllowAsExpressionSeparator: true

Performance/FlatMap:
Style/StabbyLambdaParentheses:
Enabled: true

Performance/UnfreezeString:
# Use `"foo"` not `'foo'` unless escaping is required
Style/StringLiterals:
Enabled: true
EnforcedStyle: double_quotes
Include:
- "app/**/*"
- "config/**/*"
- "lib/**/*"
- "test/**/*"
- "Gemfile"

Style/TrailingCommaInArrayLiteral:
Enabled: true

Style/TrailingCommaInHashLiteral:
Enabled: true