1
+ require :
2
+ - rubocop-rspec
3
+ - rubocop-rails
4
+ - rubocop-performance
1
5
AllCops :
2
6
Exclude :
3
7
- " vendor/**/*"
4
8
- " spec/dummy/db/schema.rb"
5
9
- " db/schema.rb"
6
10
- " bin/**/*"
7
11
- " spec/dummy/db/schema.rb"
8
- DisplayCopNames : false
9
12
TargetRubyVersion : 2.7
10
13
Rails :
11
14
Enabled : true
12
- Layout/AlignParameters :
15
+ Performance :
16
+ Enabled : true
17
+ Layout/ParameterAlignment :
13
18
Description : Align the parameters of a method call if they span more than one line.
14
19
StyleGuide : https://github.com/bbatsov/ruby-style-guide#no-double-indent
15
20
Enabled : true
@@ -121,7 +126,7 @@ Naming/PredicateName:
121
126
- is_
122
127
- has_
123
128
- have_
124
- NamePrefixBlacklist :
129
+ ForbiddenPrefixes :
125
130
- is_
126
131
Style/RaiseArgs :
127
132
Description : Checks the arguments passed to raise/fail.
@@ -172,7 +177,7 @@ Style/TrivialAccessors:
172
177
ExactNameMatch : false
173
178
AllowPredicates : false
174
179
AllowDSLWriters : false
175
- Whitelist :
180
+ AllowedMethods :
176
181
- to_ary
177
182
- to_a
178
183
- to_c
@@ -200,6 +205,17 @@ Style/WordArray:
200
205
Enabled : false
201
206
MinSize : 0
202
207
WordRegex : !ruby/regexp /\A[\p{Word}]+\z/
208
+ Style/ExponentialNotation :
209
+ Enabled : true
210
+ Style/HashEachMethods :
211
+ Description : Use Hash#each_key and Hash#each_value.
212
+ Enabled : true
213
+ Style/HashTransformKeys :
214
+ Description : Prefer `transform_keys` over `each_with_object` and `map`.
215
+ Enabled : true
216
+ Style/HashTransformValues :
217
+ Description : Prefer `transform_values` over `each_with_object` and `map`.
218
+ Enabled : true
203
219
Metrics/AbcSize :
204
220
Description : A calculated magnitude based on number of assignments, branches, and
205
221
conditions.
@@ -215,15 +231,6 @@ Metrics/ClassLength:
215
231
Enabled : false
216
232
CountComments : false
217
233
Max : 100
218
- Metrics/LineLength :
219
- Description : Limit lines to 100 characters.
220
- StyleGuide : https://github.com/bbatsov/ruby-style-guide#100-character-limits
221
- Enabled : true
222
- Max : 100
223
- AllowURI : true
224
- URISchemes :
225
- - http
226
- - https
227
234
Metrics/MethodLength :
228
235
Description : Avoid methods longer than 15 lines of code.
229
236
StyleGuide : https://github.com/bbatsov/ruby-style-guide#short-methods
@@ -243,6 +250,15 @@ Lint/AssignmentInCondition:
243
250
StyleGuide : https://github.com/bbatsov/ruby-style-guide#safe-assignment-in-condition
244
251
Enabled : false
245
252
AllowSafeAssignment : true
253
+ Layout/LineLength :
254
+ Description : Limit lines to 100 characters.
255
+ StyleGuide : https://github.com/bbatsov/ruby-style-guide#100-character-limits
256
+ Enabled : true
257
+ Max : 100
258
+ AllowURI : true
259
+ URISchemes :
260
+ - http
261
+ - https
246
262
Layout/EndAlignment :
247
263
Description : Align ends correctly.
248
264
Enabled : true
@@ -257,13 +273,69 @@ Layout/DefEndAlignment:
257
273
SupportedStylesAlignWith :
258
274
- start_of_line
259
275
- def
276
+ Layout/SpaceAroundMethodCallOperator :
277
+ Description : Checks method call operators to not have spaces around them.
278
+ Enabled : true
260
279
Style/SymbolArray :
261
280
Description : Use %i or %I for arrays of symbols.
262
281
StyleGuide : https://github.com/bbatsov/ruby-style-guide#percent-i
263
282
Enabled : false
264
283
Layout/ExtraSpacing :
265
284
Description : Do not use unnecessary spacing.
266
285
Enabled : false
286
+ Layout/ClassStructure :
287
+ Enabled : true
288
+ Categories :
289
+ validation :
290
+ - validate
291
+ - validates
292
+ association :
293
+ - belongs_to
294
+ - has_one
295
+ - has_many
296
+ - has_and_belongs_to_many
297
+ attribute_macros :
298
+ - attribute
299
+ - attr_accessor
300
+ - attr_reader
301
+ - attr_writer
302
+ callbacks :
303
+ - before_validation
304
+ - after_validation
305
+ - before_save
306
+ - before_create
307
+ - after_create
308
+ - after_save
309
+ - after_commit
310
+ - after_create_commit
311
+ other_macros :
312
+ - devise
313
+ - acts_as_token_authenticatable
314
+ - accepts_nested_attributes_for
315
+ - humanize
316
+ - monetize
317
+ scope :
318
+ - scope
319
+ - pg_search_scope
320
+ ExpectedOrder :
321
+ - module_inclusion
322
+ - constants
323
+ - public_attribute_macros
324
+ - association
325
+ - validation
326
+ - enum
327
+ - aasm
328
+ - scope
329
+ - public_delegate
330
+ - other_macros
331
+ - class_methods
332
+ - initializer
333
+ - public_methods
334
+ - protected_attribute_macros
335
+ - protected_methods
336
+ - private_attribute_macros
337
+ - private_delegate
338
+ - private_methods
267
339
Naming/AccessorMethodName :
268
340
Description : Check the naming of accessor methods for get_/set_.
269
341
Enabled : false
@@ -444,7 +516,7 @@ Lint/DeprecatedClassMethods:
444
516
Lint/ElseLayout :
445
517
Description : Check for odd code arrangement in an else block.
446
518
Enabled : false
447
- Lint/HandleExceptions :
519
+ Lint/SuppressedException :
448
520
Description : Don't suppress exception.
449
521
StyleGuide : https://github.com/bbatsov/ruby-style-guide#dont-hide-exceptions
450
522
Enabled : false
@@ -472,10 +544,43 @@ Lint/UnderscorePrefixedVariableName:
472
544
Lint/Void :
473
545
Description : Possible use of operator/literal/variable in void context.
474
546
Enabled : false
475
- Rails/Delegate :
476
- Description : Prefer delegate method for delegations.
477
- Enabled : false
547
+ Lint/RaiseException :
548
+ Description : Checks for `raise` or `fail` statements which are raising `Exception` class.
549
+ Enabled : true
550
+ Lint/StructNewOverride :
551
+ Description : Disallow overriding the `Struct` built-in methods via `Struct.new`.
552
+ Enabled : true
478
553
Performance/RedundantBlockCall :
479
554
Description : Use `yield` instead of `block.call`.
480
555
Reference : https://github.com/JuanitoFatas/fast-ruby#proccall-vs-yield-code
481
556
Enabled : false
557
+ Style/OptionalBooleanParameter :
558
+ Description : ' Use keyword arguments when defining method with boolean argument.'
559
+ Enabled : false
560
+ Lint/MissingSuper :
561
+ Description : >-
562
+ This cop checks for the presence of constructors and lifecycle callbacks
563
+ without calls to `super`'.
564
+ Enabled : false
565
+ Style/RedundantFileExtensionInRequire :
566
+ Description : >-
567
+ Checks for the presence of superfluous `.rb` extension in
568
+ the filename provided to `require` and `require_relative`.
569
+ Enabled : false
570
+ Gemspec/RequiredRubyVersion :
571
+ Enabled : false
572
+ RSpec/MultipleExpectations :
573
+ Max : 5
574
+ RSpec/NestedGroups :
575
+ Max : 5
576
+ RSpec/ExampleLength :
577
+ Max : 10
578
+ RSpec/LetSetup :
579
+ Enabled : false
580
+ RSpec/ExpectChange :
581
+ Enabled : true
582
+ EnforcedStyle : block
583
+ RSpec/FilePath :
584
+ Enabled : false
585
+ RSpec/InstanceVariable :
586
+ Enabled : false
0 commit comments