|
|
@@ -3,12 +3,24 @@ require: rubocop-performance
|
|
|
AllCops:
|
|
|
TargetRubyVersion: 2.6.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
|
|
|
+ # to leave them active, so we can selectively disable cops where appropriate.
|
|
|
+ DisabledByDefault: false
|
|
|
+
|
|
|
+ # Ignore most generated files
|
|
|
Exclude:
|
|
|
- '**/templates/**/*'
|
|
|
- '**/vendor/**/*'
|
|
|
- '**/node_modules/**/*'
|
|
|
+ - 'bin/bundle'
|
|
|
+ - 'bin/rails'
|
|
|
+ - 'bin/rake'
|
|
|
+ - 'bin/setup'
|
|
|
+ - 'bin/spring'
|
|
|
+ - 'bin/update'
|
|
|
+ - 'bin/webpack'
|
|
|
+ - 'bin/webpack-dev-server'
|
|
|
+ - 'bin/yarn'
|
|
|
+ - 'db/schema.rb'
|
|
|
|
|
|
Performance:
|
|
|
Exclude:
|
|
|
@@ -17,7 +29,6 @@ Performance:
|
|
|
Rails:
|
|
|
Enabled: true
|
|
|
|
|
|
-
|
|
|
# Prefer &&/|| over and/or.
|
|
|
Style/AndOr:
|
|
|
Enabled: true
|
|
|
@@ -121,27 +132,51 @@ Style/MethodDefParentheses:
|
|
|
Style/FrozenStringLiteralComment:
|
|
|
Enabled: true
|
|
|
EnforcedStyle: always
|
|
|
-# Exclude:
|
|
|
-# - 'actionview/test/**/*.builder'
|
|
|
-# - 'actionview/test/**/*.ruby'
|
|
|
-# - 'actionpack/test/**/*.builder'
|
|
|
-# - 'actionpack/test/**/*.ruby'
|
|
|
-# - 'activestorage/db/migrate/**/*.rb'
|
|
|
-# - 'activestorage/db/update_migrate/**/*.rb'
|
|
|
-# - 'actionmailbox/db/migrate/**/*.rb'
|
|
|
-# - 'actiontext/db/migrate/**/*.rb'
|
|
|
+ Exclude:
|
|
|
+ - 'db/schema.rb'
|
|
|
|
|
|
Style/RedundantFreeze:
|
|
|
Enabled: true
|
|
|
|
|
|
+Style/Documentation:
|
|
|
+ Enabled: false
|
|
|
+
|
|
|
+Style/ClassAndModuleChildren:
|
|
|
+ Enabled: false
|
|
|
+
|
|
|
+Style/BlockComments:
|
|
|
+ Enabled: false
|
|
|
+
|
|
|
+Style/RescueModifier:
|
|
|
+ Enabled: false
|
|
|
+
|
|
|
+Style/GuardClause:
|
|
|
+ Enabled: false
|
|
|
+
|
|
|
+Metrics/BlockLength:
|
|
|
+ Enabled: false
|
|
|
+
|
|
|
+Metrics/LineLength:
|
|
|
+ Max: 120
|
|
|
+
|
|
|
+Metrics/MethodLength:
|
|
|
+ Max: 20
|
|
|
+
|
|
|
+Metrics/AbcSize:
|
|
|
+ Enabled: false
|
|
|
+
|
|
|
# Use `foo {}` not `foo{}`.
|
|
|
Layout/SpaceBeforeBlockBraces:
|
|
|
Enabled: true
|
|
|
+ Exclude:
|
|
|
+ - '**/spec/**/*'
|
|
|
|
|
|
# Use `foo { bar }` not `foo {bar}`.
|
|
|
Layout/SpaceInsideBlockBraces:
|
|
|
Enabled: true
|
|
|
EnforcedStyleForEmptyBraces: space
|
|
|
+ Exclude:
|
|
|
+ - '**/spec/**/*'
|
|
|
|
|
|
# Use `{ a: 1 }` not `{a:1}`.
|
|
|
Layout/SpaceInsideHashLiteralBraces:
|
|
|
@@ -150,10 +185,14 @@ Layout/SpaceInsideHashLiteralBraces:
|
|
|
Layout/SpaceInsideParens:
|
|
|
Enabled: true
|
|
|
|
|
|
+Style/TrailingCommaInHashLiteral:
|
|
|
+ Enabled: true
|
|
|
+ EnforcedStyleForMultiline: comma
|
|
|
+
|
|
|
# Check quotes usage according to lint rule below.
|
|
|
Style/StringLiterals:
|
|
|
Enabled: true
|
|
|
- EnforcedStyle: double_quotes
|
|
|
+ EnforcedStyle: single_quotes
|
|
|
|
|
|
# Detect hard tabs, no hard tabs.
|
|
|
Layout/Tab:
|