1
1
require : rubocop-performance
2
2
3
- inherit_gem :
4
- rubocop-rails_config :
5
- - config/rails.yml
6
-
7
3
AllCops :
8
4
TargetRubyVersion : 2.5
9
5
Exclude :
10
6
- bin/**/*
11
7
- test/dummy/bin/**/*
12
8
- test/dummy/db/schema.rb
13
9
10
+ Performance :
11
+ Exclude :
12
+ - ' test/**/*'
13
+
14
+ Rails :
15
+ Enabled : true
16
+
14
17
Metrics/LineLength :
15
18
Max : 150
16
19
17
- # frozen_string_literal: true
18
- Style/FrozenStringLiteralComment :
19
- Enabled : true
20
- EnforcedStyle : when_needed
20
+ Style/GuardClause :
21
+ Enabled : false
22
+
23
+ Style/Documentation :
24
+ Enabled : false
25
+
26
+ # Prefer assert_not over assert !
27
+ Rails/AssertNot :
28
+ Include :
29
+ - ' test/**/*'
30
+
31
+ # Prefer assert_not_x over refute_x
32
+ Rails/RefuteMethods :
33
+ Include :
34
+ - ' test/**/*'
21
35
22
36
# Prefer &&/|| over and/or.
23
37
Style/AndOr :
@@ -27,6 +41,7 @@ Style/AndOr:
27
41
# method call.
28
42
Style/BracesAroundHashParameters :
29
43
Enabled : true
44
+ EnforcedStyle : context_dependent
30
45
31
46
# Align `when` with `case`.
32
47
Layout/CaseIndentation :
@@ -36,8 +51,20 @@ Layout/CaseIndentation:
36
51
Layout/CommentIndentation :
37
52
Enabled : true
38
53
39
- # No extra empty lines.
40
- Layout/EmptyLines :
54
+ Layout/ElseAlignment :
55
+ Enabled : true
56
+
57
+ # Align `end` with the matching keyword or starting expression except for
58
+ # assignments, where it should be aligned with the LHS.
59
+ Layout/EndAlignment :
60
+ Enabled : true
61
+ EnforcedStyleAlignWith : variable
62
+ AutoCorrect : true
63
+
64
+ Layout/EmptyLineAfterMagicComment :
65
+ Enabled : true
66
+
67
+ Layout/EmptyLinesAroundBlockBody :
41
68
Enabled : true
42
69
43
70
# In a regular class definition, no empty lines around the body.
@@ -52,26 +79,35 @@ Layout/EmptyLinesAroundMethodBody:
52
79
Layout/EmptyLinesAroundModuleBody :
53
80
Enabled : true
54
81
55
- # Use Ruby >= 1.9 syntax for hashes. Prefer {a: :b} over { :a => :b }.
82
+ Layout/IndentFirstArgument :
83
+ Enabled : true
84
+
85
+ # Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }.
56
86
Style/HashSyntax :
57
87
Enabled : true
58
88
59
89
# Method definitions after `private` or `protected` isolated calls need one
60
90
# extra level of indentation.
61
91
Layout/IndentationConsistency :
62
92
Enabled : true
63
- EnforcedStyle : normal
93
+ EnforcedStyle : rails
64
94
65
95
# Two spaces, no tabs (for indentation).
66
96
Layout/IndentationWidth :
67
97
Enabled : true
68
98
99
+ Layout/LeadingCommentSpace :
100
+ Enabled : true
101
+
69
102
Layout/SpaceAfterColon :
70
103
Enabled : true
71
104
72
105
Layout/SpaceAfterComma :
73
106
Enabled : true
74
107
108
+ Layout/SpaceAfterSemicolon :
109
+ Enabled : true
110
+
75
111
Layout/SpaceAroundEqualsInParameterDefault :
76
112
Enabled : true
77
113
@@ -81,24 +117,38 @@ Layout/SpaceAroundKeyword:
81
117
Layout/SpaceAroundOperators :
82
118
Enabled : true
83
119
120
+ Layout/SpaceBeforeComma :
121
+ Enabled : true
122
+
84
123
Layout/SpaceBeforeFirstArg :
85
124
Enabled : true
86
125
126
+ Style/DefWithParentheses :
127
+ Enabled : true
128
+
87
129
# Defining a method with parameters needs parentheses.
88
130
Style/MethodDefParentheses :
89
131
Enabled : true
90
132
133
+ Style/FrozenStringLiteralComment :
134
+ Enabled : true
135
+ EnforcedStyle : always
136
+
137
+ Style/RedundantFreeze :
138
+ Enabled : true
139
+
91
140
# Use `foo {}` not `foo{}`.
92
141
Layout/SpaceBeforeBlockBraces :
93
142
Enabled : true
94
143
95
144
# Use `foo { bar }` not `foo {bar}`.
96
145
Layout/SpaceInsideBlockBraces :
97
146
Enabled : true
147
+ EnforcedStyleForEmptyBraces : space
98
148
99
- # Use `{a: 1}` not `{ a:1 }`.
149
+ # Use `{ a: 1 }` not `{a:1}`.
100
150
Layout/SpaceInsideHashLiteralBraces :
101
- Enabled : false
151
+ Enabled : true
102
152
103
153
Layout/SpaceInsideParens :
104
154
Enabled : true
@@ -124,45 +174,72 @@ Layout/TrailingWhitespace:
124
174
Style/UnneededPercentQ :
125
175
Enabled : true
126
176
127
- # Align `end` with the matching keyword or starting expression except for
128
- # assignments, where it should be aligned with the LHS.
129
- Layout/EndAlignment :
177
+ Lint/AmbiguousOperator :
178
+ Enabled : true
179
+
180
+ Lint/AmbiguousRegexpLiteral :
181
+ Enabled : true
182
+
183
+ Lint/ErbNewArguments :
130
184
Enabled : true
131
- EnforcedStyleAlignWith : variable
132
185
133
186
# Use my_method(my_arg) not my_method( my_arg ) or my_method my_arg.
134
187
Lint/RequireParentheses :
135
188
Enabled : true
136
189
137
- Style/Documentation :
138
- Enabled : false
190
+ Lint/ShadowingOuterLocalVariable :
191
+ Enabled : true
139
192
140
- Metrics/MethodLength :
141
- Enabled : false
193
+ Lint/StringConversionInInterpolation :
194
+ Enabled : true
142
195
143
- Metrics/AbcSize :
144
- Enabled : false
196
+ Lint/UriEscapeUnescape :
197
+ Enabled : true
145
198
146
- Metrics/ParameterLists :
147
- Enabled : false
199
+ Lint/UselessAssignment :
200
+ Enabled : true
148
201
149
- Metrics/BlockLength :
150
- Enabled : false
202
+ Lint/DeprecatedClassMethods :
203
+ Enabled : true
151
204
152
- Lint/HandleExceptions :
153
- Enabled : false
205
+ Style/ParenthesesAroundCondition :
206
+ Enabled : true
154
207
155
- Metrics/ClassLength :
156
- Enabled : false
208
+ Style/RedundantBegin :
209
+ Enabled : true
157
210
158
- Layout/EmptyLinesAroundArguments :
159
- Enabled : false
211
+ Style/RedundantReturn :
212
+ Enabled : true
213
+ AllowMultipleReturnValues : true
160
214
161
- Style/ClassAndModuleChildren :
162
- Enabled : false
215
+ Style/Semicolon :
216
+ Enabled : true
217
+ AllowAsExpressionSeparator : true
163
218
164
- Naming/UncommunicativeMethodParamName :
165
- Enabled : false
219
+ # Prefer Foo.method over Foo::method
220
+ Style/ColonMethodCall :
221
+ Enabled : true
166
222
167
- Style/IfUnlessModifier :
168
- Enabled : false
223
+ Style/TrivialAccessors :
224
+ Enabled : true
225
+
226
+ Performance/FlatMap :
227
+ Enabled : true
228
+
229
+ Performance/RedundantMerge :
230
+ Enabled : true
231
+
232
+ Performance/StartWith :
233
+ Enabled : true
234
+
235
+ Performance/EndWith :
236
+ Enabled : true
237
+
238
+ Performance/RegexpMatch :
239
+ Enabled : true
240
+
241
+ Performance/ReverseEach :
242
+ Enabled : true
243
+
244
+ Performance/UnfreezeString :
245
+ Enabled : true
0 commit comments