-
Notifications
You must be signed in to change notification settings - Fork 77
/
.rubocop.yml
767 lines (604 loc) · 23.5 KB
/
.rubocop.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
require:
- rubocop-performance
- rubocop-rails
- rubocop-rspec
AllCops:
TargetRubyVersion: 3.1.2
# 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
SuggestExtensions: false
Exclude:
- "app/javascript/**/*"
- "app/assets/**/*"
- "app/views/**/*.erb"
- "lib/tasks/**/*"
- ".vscode/**/*"
- ".husky/**/*"
- ".bundle/**/*"
- "**/log/**/*"
- "**/public/**/*"
- "**/tmp/**/*"
- "**/templates/**/*"
- "**/vendor/**/*"
- "node_modules/**/*"
- "bin/**/*"
- "config/webpack/**/*"
- "db/schema.rb"
Performance:
Exclude:
- "**/test/**/*"
# Prefer assert_not over assert !
Rails/AssertNot:
Include:
- "**/test/**/*"
# Prefer assert_not_x over refute_x
Rails/RefuteMethods:
Include:
- "**/test/**/*"
Rails/IndexBy:
Enabled: true
Rails/IndexWith:
Enabled: true
Layout/ClosingHeredocIndentation:
Enabled: true
Layout/ElseAlignment:
Enabled: true
Layout/EmptyLinesAroundBlockBody:
Enabled: true
Layout/SpaceAfterSemicolon:
Enabled: true
Layout/SpaceBeforeComment:
Enabled: true
Layout/ArrayAlignment:
Enabled: true
Layout/AssignmentIndentation:
Enabled: true
Layout/BlockEndNewline:
Enabled: true
Style/RedundantFreeze:
Enabled: true
Lint/AmbiguousOperator:
Enabled: true
Lint/AmbiguousRegexpLiteral:
Enabled: true
Lint/DuplicateRequire:
Enabled: true
Lint/ErbNewArguments:
Enabled: true
Lint/RedundantStringCoercion:
Enabled: true
Lint/UriEscapeUnescape:
Enabled: true
Lint/DeprecatedClassMethods:
Enabled: true
# ====================================================================================================
# All access modifier related rules
# ====================================================================================================
# Add a newline before and after private keyword or other access modifiers
Layout/EmptyLinesAroundAccessModifier:
Enabled: true
# This cop checks for redundant access modifiers, including those with no code,
# those which are repeated, and leading `public` modifiers in a class or module body.
Lint/UselessAccessModifier:
Enabled: true
Style/AccessModifierDeclarations:
Enabled: true
Layout/AccessModifierIndentation:
Enabled: true
# ====================================================================================================
# All comment related rules
# ====================================================================================================
# Align comments with method definitions.
Layout/CommentIndentation:
Enabled: true
# Requires an empty line after frozen_string_literal: true comment
Layout/EmptyLineAfterMagicComment:
Enabled: true
# frozen_string_literal: true magic comment is required on the top of files
Style/FrozenStringLiteralComment:
Enabled: true
EnforcedStyle: always
SafeAutoCorrect: true
# ====================================================================================================
# All Class related rules
# ====================================================================================================
# Helps in brining the include statements etc to top of the class definition
Layout/ClassStructure:
Enabled: true
Description: "Enforces a canonical order of definitions within a class body."
StyleGuide: "https://github.com/bbatsov/ruby-style-guide#consistent-classes"
# In a regular class definition, no empty lines around the body.
Layout/EmptyLinesAroundClassBody:
Enabled: true
# ====================================================================================================
# All Method related rules
# ====================================================================================================
# This cop checks whether class/module/method definitions are separated by one or more empty lines.
Layout/EmptyLineBetweenDefs:
Enabled: true
# This cop checks the . position in multi-line method calls.
# The dot should be leading rather than trailing.
Layout/DotPosition:
Enabled: true
EnforcedStyle: leading
# No space in method name and the arguments
Lint/ParenthesesAsGroupedExpression:
Enabled: true
# Use my_method(my_arg) not my_method( my_arg ) or my_method my_arg,
# when a boolean operator, && or ||, is chained along with this method/argument
Lint/RequireParentheses:
Enabled: true
# avoid redundant `return` expressions
Style/RedundantReturn:
Enabled: true
AllowMultipleReturnValues: true
# Ensures that exactly one space is used between a method name and the
# first argument for method calls without parentheses
Layout/SpaceBeforeFirstArg:
Enabled: true
# Methods that doesn't take any parameters shouldn't have paranthesis in its definition
Style/DefWithParentheses:
Enabled: true
# Defining a method with parameters needs parentheses.
Style/MethodDefParentheses:
Enabled: true
Layout/SpaceAroundEqualsInParameterDefault:
Enabled: true
# This cop checks for a line break before the first argument in a multi-line method call.
Layout/FirstMethodArgumentLineBreak:
Enabled: true
# Method definitions after `private` or `protected` isolated calls need one
# extra level of indentation.
Layout/IndentationConsistency:
Enabled: true
EnforcedStyle: indented_internal_methods
# This cop checks the indentation of the method name part in method calls that span more than one line.
Layout/MultilineMethodCallIndentation:
Enabled: true
EnforcedStyle: indented
# This cop ensures the indentation of the first parameter in a method definition.
Layout/FirstParameterIndentation:
Enabled: true
EnforcedStyle: consistent
# When we write method arguments in next line, indent it.
Layout/FirstArgumentIndentation:
Enabled: true
EnforcedStyle: consistent
# Alignment of args from second argument onwards should be indented
Layout/ArgumentAlignment:
Enabled: true
EnforcedStyle: with_fixed_indentation
# In a regular method definition, no empty lines around the body.
Layout/EmptyLinesAroundMethodBody:
Enabled: true
# ====================================================================================================
# All Hash related rules
# ====================================================================================================
Layout/HashAlignment:
Enabled: true
EnforcedColonStyle: key
EnforcedLastArgumentHashStyle: always_inspect
# This cop checks for a line break before the first element in a multi-line hash.
Layout/FirstHashElementLineBreak:
Enabled: true
# When using the `new_line` style:
# The closing brace of a multi-line hash literal must be on
# the line after the last element of the hash.
Layout/MultilineHashBraceLayout:
Enabled: true
EnforcedStyle: new_line
Layout/FirstHashElementIndentation:
Enabled: true
EnforcedStyle: consistent
# Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }.
Style/HashSyntax:
Enabled: true
# Use `{ a: 1 }` not `{a:1}`.
Layout/SpaceInsideHashLiteralBraces:
Enabled: true
# `no_comma`: Does not requires a comma after the last item in a hash
Style/TrailingCommaInHashLiteral:
Enabled: true
# ====================================================================================================
# All misc whitespace related rules
# ====================================================================================================
Layout/SpaceAfterColon:
Enabled: true
# Ensures comma (,) is followed by some kind of space.
Layout/SpaceAfterComma:
Enabled: true
# Every ruby keyword should be surrounded by spaces
Layout/SpaceAroundKeyword:
Enabled: true
# Requires proper spacing around ruby operator symbols.
Layout/SpaceAroundOperators:
Enabled: true
## Allows multiple spaces for keeping alignment
# {
# 1 => 2,
# 11 => 3
# }
AllowForAlignment: true
# Ensures comma symbol is not preceded by space
Layout/SpaceBeforeComma:
Enabled: true
# Use `foo {}` not `foo{}`.
Layout/SpaceBeforeBlockBraces:
Enabled: true
# Use `foo { bar }` not `foo {bar}`.
Layout/SpaceInsideBlockBraces:
Enabled: true
# enforces that parentheses do not have spaces
Layout/SpaceInsideParens:
Enabled: true
# No trailing whitespace.
Layout/TrailingWhitespace:
Enabled: true
# Require a space after comment
Layout/LeadingCommentSpace:
Enabled: true
# ====================================================================================================
# All empty lines related rules
# ====================================================================================================
Layout/EndOfLine:
Enabled: true
EnforcedStyle: lf
# In a regular module definition, no empty lines around the body.
Layout/EmptyLinesAroundModuleBody:
Enabled: true
Layout/EmptyLineAfterGuardClause:
Enabled: true
# Requires a single final blank line to the file.
# `final_blank_line` ensures a blank line before EOF.
Layout/TrailingEmptyLines:
Enabled: true
# This cop checks for two or more consecutive blank lines.
# This rule is not same as TrailingEmptyLines, because:
Layout/EmptyLines:
Enabled: true
# ====================================================================================================
# All misc rules that don't fall into other categories
# ====================================================================================================
# Prefer &&/|| over and/or.
Style/AndOr:
Enabled: true
# Align `when` with `case`.
Layout/CaseIndentation:
Enabled: true
Layout/LineLength:
Enabled: true
Max: 120
AllowedPatterns: [
'^\s*#', # line that begins with comment
'^\s*"', # line that begins with double quote (long string literal)
"^\\s*'", # line that begins with single quote (long string literal)
'"$', # line that ends with double quote (long string variable assignment)
"'$", # line that ends with single quote (long string variable assignment)
'\/$', # line that ends with slash (long regex variable assignment)
]
# Indent using two spaces
Layout/IndentationWidth:
Enabled: true
Width: 2
# Use spaces for indentation. Not tabs
Layout/IndentationStyle:
Enabled: true
EnforcedStyle: spaces
# Remove extra/unnecessary whitespace which's used for alignment.
# A developer shouldn't waste time indenting code with whitespaces.
Layout/ExtraSpacing:
Enabled: true
AllowForAlignment: false
# Helps in removing unwanted parentheses.
Style/ParenthesesAroundCondition:
Enabled: true
# Enforce string literals to use double quotes everywhere
Style/StringLiterals:
Enabled: true
EnforcedStyle: double_quotes
# Use quotes for string literals when they are enough.
Style/RedundantPercentQ:
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
# avoid lines terminated with a semicolon.
Style/Semicolon:
Enabled: true
# disallow multiple statements in a line
AllowAsExpressionSeparator: false
# Corrects usage of :true/:false to true/false
Lint/BooleanSymbol:
Enabled: true
# ====================================================================================================
# All flow(if/while/for/until) statements related
# ====================================================================================================
Lint/AssignmentInCondition:
Enabled: true
AllowSafeAssignment: true
# ====================================================================================================
# All Bundler cop rules
# ====================================================================================================
Bundler/OrderedGems:
Enabled: true
TreatCommentsAsGroupSeparators: true
# ====================================================================================================
# All Rails cop rules
# ====================================================================================================
# Enabled Rails cops for the command for VSCode linting and while running rubocop -a
Rails:
Enabled: false
Style/HashTransformKeys:
Enabled: true
Style/HashTransformValues:
Enabled: true
Style/RedundantBegin:
Enabled: true
Style/RedundantRegexpEscape:
Enabled: true
# Prefer Foo.method over Foo::method
Style/ColonMethodCall:
Enabled: true
Style/TrivialAccessors:
Enabled: true
Performance/BindCall:
Enabled: true
Performance/FlatMap:
Enabled: true
Performance/MapCompact:
Enabled: true
Performance/SelectMap:
Enabled: true
Performance/RedundantMerge:
Enabled: true
Performance/StartWith:
Enabled: true
Performance/EndWith:
Enabled: true
Performance/RegexpMatch:
Enabled: true
Performance/ReverseEach:
Enabled: true
Performance/StringReplacement:
Enabled: true
Performance/UnfreezeString:
Enabled: true
Performance/DeletePrefix:
Enabled: true
Performance/DeleteSuffix:
Enabled: true
# RSpec cops from rubocop-rspec
# https://github.com/rubocop-hq/rubocop-rspec/blob/master/config/default.yml
RSpec/Be:
Description: Check for expectations where be is used without argument.
Enabled: true
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Be
RSpec/ContextMethod:
Description: context should not be used for specifying methods.
Enabled: true
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ContextMethod
RSpec/ContextWording:
Description: Checks that context docstring starts with an allowed prefix.
Enabled: true
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ContextWording
Prefixes:
- when
- with
- without
- if
- unless
- for
RSpec/DescribeClass:
Description:
Check that the first argument to the top level describe is a constant.
Enabled: true
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/DescribeClass
Exclude:
- "spec/requests/**/*"
- "spec/feature/**/*"
- "spec/system/**/*"
RSpec/DescribedClassModuleWrapping:
Description: Avoid opening modules and defining specs within them.
Enabled: true
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/DescribedClassModuleWrapping
RSpec/DescribeSymbol:
Description: Avoid describing symbols.
Enabled: true
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/DescribeSymbol
RSpec/EmptyExampleGroup:
Description: Checks if an example group does not include any tests.
Enabled: true
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/EmptyExampleGroup
RSpec/EmptyHook:
Description: Checks for empty before and after hooks.
Enabled: true
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/EmptyHook
RSpec/EmptyLineAfterExample:
Description: Checks if there is an empty line after example blocks.
Enabled: true
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/EmptyLineAfterExample
RSpec/EmptyLineAfterExampleGroup:
Description: Checks if there is an empty line after example group blocks.
Enabled: true
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/EmptyLineAfterExampleGroup
RSpec/EmptyLineAfterFinalLet:
Description: Checks if there is an empty line after the last let block.
Enabled: true
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/EmptyLineAfterFinalLet
RSpec/EmptyLineAfterHook:
Description: Checks if there is an empty line after hook blocks.
Enabled: true
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/EmptyLineAfterHook
RSpec/EmptyLineAfterSubject:
Description: Checks if there is an empty line after subject block.
Enabled: true
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/EmptyLineAfterSubject
RSpec/ExampleLength:
Description: Checks for long examples.
Enabled: true
Max: 16
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ExampleLength
RSpec/ExampleWithoutDescription:
Description: Checks for examples without a description.
Enabled: true
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ExampleWithoutDescription
RSpec/ExampleWording:
Description: Checks for common mistakes in example descriptions.
Enabled: true
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ExampleWording
RSpec/ExcessiveDocstringSpacing:
Description: Checks for excessive whitespace in example descriptions.
Enabled: true
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ExcessiveDocstringSpacing
RSpec/ExpectActual:
Description: Checks for expect(…) calls containing literal values.
Enabled: true
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ExpectActual
RSpec/ExpectChange:
Description: Checks for consistent style of change matcher.
Enabled: true
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ExpectChange
RSpec/ExpectOutput:
Description: Checks for opportunities to use expect { … }.to output.
Enabled: true
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ExpectOutput
RSpec/ExpectInHook:
Description: Do not use expect in hooks such as before.
Enabled: true
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ExpectInHook
RSpec/FilePath:
Description: Checks that spec file paths are consistent and well-formed.
Enabled: true
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/FilePath
RSpec/HookArgument:
Description: Checks the arguments passed to before, around, and after.
Enabled: true
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/HookArgument
RSpec/HooksBeforeExamples:
Description: Checks for before/around/after hooks that come after an example.
Enabled: true
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/HooksBeforeExamples
RSpec/IdenticalEqualityAssertion:
Description:
Checks for equality assertions with identical expressions on both sides.
Enabled: true
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/IdenticalEqualityAssertion
RSpec/ImplicitExpect:
Description: Check that a consist implict expectation style is used.
Enabled: true
EnforcedStyle: is_expected
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ImplicitExpect
RSpec/ImplicitSubject:
Description: Checks for usage of implicit subject (is_expected / should).
Enabled: true
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ImplicitSubject
RSpec/ItBehavesLike:
Description: Checks that only one it_behaves_like style is used.
Enabled: true
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ItBehavesLike
RSpec/LetBeforeExamples:
Description: Checks for let definitions that come after an example.
Enabled: true
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/LetBeforeExamples
RSpec/LetSetup:
Description: Checks unreferenced let! calls being used for test setup.
Enabled: true
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/LetSetup
RSpec/MessageExpectation:
Description: Checks for consistent message expectation style.
Enabled: true
EnforcedStyle: allow
RSpec/MultipleMemoizedHelpers:
Description:
Checks if example groups contain too many `let` and `subject` calls.
Enabled: true
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/MultipleMemoizedHelpers
Max: 15
RSpec/MissingExampleGroupArgument:
Description: Checks that the first argument to an example group is not empty.
Enabled: true
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/MissingExampleGroupArgument
RSpec/MultipleDescribes:
Description: Checks for multiple top-level example groups.
Enabled: true
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/MultipleDescribes
RSpec/MultipleExpectations:
Description: Checks if examples contain too many `expect` calls.
Enabled: true
Max: 8
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/MultipleExpectations
RSpec/MultipleSubjects:
Description: Checks if an example group defines subject multiple times.
Enabled: true
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/MultipleSubjects
RSpec/NotToNot:
Description: Checks for consistent method usage for negating expectations.
Enabled: true
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/NotToNot
RSpec/RepeatedDescription:
Description: Check for repeated description strings in example groups.
Enabled: true
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/RepeatedDescription
RSpec/RepeatedExampleGroupDescription:
Description: Check for repeated example group descriptions.
Enabled: true
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/RepeatedExampleGroupDescription
RSpec/RepeatedIncludeExample:
Description: Check for repeated include of shared examples.
Enabled: true
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/RepeatedIncludeExample
RSpec/SharedContext:
Description: Checks for proper shared_context and shared_examples usage.
Enabled: true
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/SharedContext
RSpec/SharedExamples:
Description: Enforces use of string to titleize shared examples.
Enabled: true
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/SharedExamples
RSpec/UnspecifiedException:
Description: Checks for a specified error in checking raised errors.
Enabled: true
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/UnspecifiedException
RSpec/VariableDefinition:
Description: Checks that memoized helpers names are symbols or strings.
Enabled: true
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/VariableDefinition
RSpec/VariableName:
Description: Checks that memoized helper names use the configured style.
Enabled: true
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/VariableName
RSpec/VoidExpect:
Description: This cop checks void expect().
Enabled: true
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/VoidExpect
# RSpec x Rails
RSpec/Rails/AvoidSetupHook:
Description:
Checks that tests use RSpec `before` hook over Rails `setup` method.
Enabled: true
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Rails/AvoidSetupHook
RSpec/Rails/HttpStatus:
Description:
Enforces use of symbolic or numeric value to describe HTTP status.
Enabled: true
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Rails/HttpStatus
# RSpec x FactoryBot
RSpec/FactoryBot/AttributeDefinedStatically:
Description: Always declare attribute values as blocks.
Enabled: true
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/FactoryBot/AttributeDefinedStatically
RSpec/FactoryBot/CreateList:
Description: Checks for create_list usage.
Enabled: true
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/FactoryBot/CreateList
RSpec/FactoryBot/FactoryClassName:
Description: Use string value when setting the class attribute explicitly.
Enabled: true
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/FactoryBot/FactoryClassName
RSpec/FactoryBot/SyntaxMethods:
Description: Use shorthands from FactoryBot::Syntax::Methods in your specs.
Enabled: true
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/FactoryBot/SyntaxMethods