aboutsummaryrefslogtreecommitdiffstats
path: root/.rubocop.yml
diff options
context:
space:
mode:
Diffstat (limited to '.rubocop.yml')
-rw-r--r--.rubocop.yml61
1 files changed, 52 insertions, 9 deletions
diff --git a/.rubocop.yml b/.rubocop.yml
index 7327f1e631..4fb4650bb9 100644
--- a/.rubocop.yml
+++ b/.rubocop.yml
@@ -1,7 +1,5 @@
-require: './ci/custom_cops/lib/custom_cops'
-
AllCops:
- TargetRubyVersion: 2.4
+ TargetRubyVersion: 2.5
# 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
@@ -10,14 +8,22 @@ AllCops:
- '**/vendor/**/*'
- 'actionpack/lib/action_dispatch/journey/parser.rb'
- 'railties/test/fixtures/tmp/**/*'
+ - 'node_modules/**/*'
-# Prefer assert_not_x over refute_x
-CustomCops/RefuteNot:
- Include:
+Performance:
+ Exclude:
- '**/test/**/*'
+Rails:
+ Enabled: true
+
# Prefer assert_not over assert !
-CustomCops/AssertNot:
+Rails/AssertNot:
+ Include:
+ - '**/test/**/*'
+
+# Prefer assert_not_x over refute_x
+Rails/RefuteMethods:
Include:
- '**/test/**/*'
@@ -52,6 +58,9 @@ Layout/EndAlignment:
Layout/EmptyLineAfterMagicComment:
Enabled: true
+Layout/EmptyLinesAroundBlockBody:
+ Enabled: true
+
# In a regular class definition, no empty lines around the body.
Layout/EmptyLinesAroundClassBody:
Enabled: true
@@ -90,6 +99,9 @@ Layout/SpaceAfterColon:
Layout/SpaceAfterComma:
Enabled: true
+Layout/SpaceAfterSemicolon:
+ Enabled: true
+
Layout/SpaceAroundEqualsInParameterDefault:
Enabled: true
@@ -100,10 +112,10 @@ Layout/SpaceAroundOperators:
Enabled: true
Layout/SpaceBeforeComma:
- Enabled: true
+ Enabled: true
Layout/SpaceBeforeFirstArg:
- Enabled: true
+ Enabled: true
Style/DefWithParentheses:
Enabled: true
@@ -122,6 +134,9 @@ Style/FrozenStringLiteralComment:
- 'actionpack/test/**/*.ruby'
- 'activestorage/db/migrate/**/*.rb'
+Style/RedundantFreeze:
+ Enabled: true
+
# Use `foo {}` not `foo{}`.
Layout/SpaceBeforeBlockBraces:
Enabled: true
@@ -129,6 +144,7 @@ Layout/SpaceBeforeBlockBraces:
# Use `foo { bar }` not `foo {bar}`.
Layout/SpaceInsideBlockBraces:
Enabled: true
+ EnforcedStyleForEmptyBraces: space
# Use `{ a: 1 }` not `{a:1}`.
Layout/SpaceInsideHashLiteralBraces:
@@ -165,6 +181,12 @@ Lint/RequireParentheses:
Lint/StringConversionInInterpolation:
Enabled: true
+Lint/UriEscapeUnescape:
+ Enabled: true
+
+Style/ParenthesesAroundCondition:
+ Enabled: true
+
Style/RedundantReturn:
Enabled: true
AllowMultipleReturnValues: true
@@ -176,3 +198,24 @@ Style/Semicolon:
# Prefer Foo.method over Foo::method
Style/ColonMethodCall:
Enabled: true
+
+Style/TrivialAccessors:
+ Enabled: true
+
+Performance/FlatMap:
+ Enabled: true
+
+Performance/RedundantMerge:
+ Enabled: true
+
+Performance/StartWith:
+ Enabled: true
+
+Performance/EndWith:
+ Enabled: true
+
+Performance/RegexpMatch:
+ Enabled: true
+
+Performance/UnfreezeString:
+ Enabled: true