.rubocop.yml 20.5 KB
Newer Older
1 2 3
require:
  - rubocop-rspec
  - ./rubocop/rubocop
R
Robert Speicher 已提交
4

Z
Z.J. van de Weg 已提交
5 6
inherit_from: .rubocop_todo.yml

7
AllCops:
Z
Z.J. van de Weg 已提交
8
  TargetRubyVersion: 2.3
Z
Z.J. van de Weg 已提交
9
  # Cop names are not d§splayed in offense messages by default. Change behavior
10 11 12 13 14 15 16 17 18 19
  # by overriding DisplayCopNames, or by giving the -D/--display-cop-names
  # option.
  DisplayCopNames: true
  # Style guide URLs are not displayed in offense messages by default. Change
  # behavior by overriding DisplayStyleGuide, or by giving the
  # -S/--display-style-guide option.
  DisplayStyleGuide: false
  # Exclude some GitLab files
  Exclude:
    - 'vendor/**/*'
M
Mike Greiling 已提交
20
    - 'node_modules/**/*'
S
Sean McGivern 已提交
21 22
    - 'db/*'
    - 'db/fixtures/**/*'
23 24 25 26 27 28 29 30 31
    - 'tmp/**/*'
    - 'bin/**/*'
    - 'lib/backup/**/*'
    - 'lib/ci/backup/**/*'
    - 'lib/tasks/**/*'
    - 'lib/ci/migrate/**/*'
    - 'lib/email_validator.rb'
    - 'lib/gitlab/upgrader.rb'
    - 'lib/gitlab/seeder.rb'
32
    - 'generator_templates/**/*'
33

34
# Style #######################################################################
35 36

# Check indentation of private/protected visibility modifiers.
37
Style/AccessModifierIndentation:
38
  Enabled: true
39

C
Connor Shea 已提交
40 41 42 43
# Check the naming of accessor methods for get_/set_.
Style/AccessorMethodName:
  Enabled: false

44
# Use alias_method instead of alias.
45
Style/Alias:
46
  EnforcedStyle: prefer_alias_method
47
  Enabled: true
48

49
# Align the elements of an array literal if they span more than one line.
50
Style/AlignArray:
51
  Enabled: true
52

53
# Align the elements of a hash literal if they span more than one line.
54
Style/AlignHash:
55
  Enabled: true
56

D
Douwe Maan 已提交
57 58 59 60 61
# Whether `and` and `or` are banned only in conditionals (conditionals)
# or completely (always).
Style/AndOr:
  Enabled: true

62
# Use `Array#join` instead of `Array#*`.
63
Style/ArrayJoin:
64
  Enabled: true
65

66
# Use only ascii symbols in comments.
67
Style/AsciiComments:
68
  Enabled: true
69

70
# Use only ascii symbols in identifiers.
71
Style/AsciiIdentifiers:
72
  Enabled: true
73

74
# Checks for uses of Module#attr.
75
Style/Attr:
76
  Enabled: true
77

78
# Avoid the use of BEGIN blocks.
79
Style/BeginBlock:
D
Dmitriy Zaporozhets 已提交
80
  Enabled: true
81

82
# Do not use block comments.
83
Style/BlockComments:
84
  Enabled: true
85

86
# Put end statement of multiline block on its own line.
87
Style/BlockEndNewline:
88
  Enabled: true
89

90 91
# Avoid using {...} for multi-line blocks (multiline chaining is # always
# ugly). Prefer {...} over do...end for single-line blocks.
92
Style/BlockDelimiters:
93
  Enabled: true
94

95
# Indentation of when in a case/when/[else/]end.
96
Style/CaseIndentation:
97
  Enabled: true
98

99
# Checks for uses of character literals.
100
Style/CharacterLiteral:
D
Dmitriy Zaporozhets 已提交
101
  Enabled: true
102

103
# Use CamelCase for classes and modules.'
104
Style/ClassAndModuleCamelCase:
D
Dmitriy Zaporozhets 已提交
105
  Enabled: true
106

107
# Checks style of children classes and modules.
108 109 110
Style/ClassAndModuleChildren:
  Enabled: false

111
# Enforces consistent use of `Object#is_a?` or `Object#kind_of?`.
112 113 114
Style/ClassCheck:
  Enabled: false

115
# Use self when defining module/class methods.
116
Style/ClassMethods:
117
  Enabled: true
118

119
# Avoid the use of class variables.
120
Style/ClassVars:
D
Dmitriy Zaporozhets 已提交
121
  Enabled: true
122

123
# Indentation of comments.
124
Style/CommentIndentation:
125
  Enabled: true
126

127
# Constants should use SCREAMING_SNAKE_CASE.
128
Style/ConstantName:
129
  Enabled: true
130

131
# Use def with parentheses when there are arguments.
132
Style/DefWithParentheses:
133
  Enabled: true
134

135
# Document classes and non-namespace modules.
136 137 138
Style/Documentation:
  Enabled: false

D
Douwe Maan 已提交
139 140 141 142
Style/DotPosition:
  Enabled: true
  EnforcedStyle: trailing

143
# Align elses and elsifs correctly.
144
Style/ElseAlignment:
145
  Enabled: true
146

147
# Use empty lines between defs.
148 149 150
Style/EmptyLineBetweenDefs:
  Enabled: false

151
# Don't use several empty lines in a row.
152
Style/EmptyLines:
153
  Enabled: true
154

155
# Keep blank lines around access modifiers.
156
Style/EmptyLinesAroundAccessModifier:
157
  Enabled: true
158

159
# Keeps track of empty lines around block bodies.
160
Style/EmptyLinesAroundBlockBody:
161
  Enabled: true
162

163
# Keeps track of empty lines around class bodies.
164
Style/EmptyLinesAroundClassBody:
165
  Enabled: true
166

167
# Keeps track of empty lines around module bodies.
168
Style/EmptyLinesAroundModuleBody:
169
  Enabled: true
170

171
# Keeps track of empty lines around method bodies.
172
Style/EmptyLinesAroundMethodBody:
173
  Enabled: true
174

175
# Avoid the use of END blocks.
176
Style/EndBlock:
177
  Enabled: true
178

179
# Use Unix-style line endings.
180
Style/EndOfLine:
181
  Enabled: true
182

183
# Favor the use of Fixnum#even? && Fixnum#odd?
184
Style/EvenOdd:
185
  Enabled: true
186

187
# Use snake_case for source file names.
188
Style/FileName:
189 190 191
  Enabled: true

# Checks for a line break before the first parameter in a multi-line method
192
# parameter definition.
193 194
Style/FirstMethodParameterLineBreak:
  Enabled: true
195

196
# Checks for flip flops.
197
Style/FlipFlop:
198
  Enabled: true
199

200
# Checks use of for or each in multiline loops.
201
Style/For:
G
Grzegorz Bizon 已提交
202
  Enabled: true
203

Z
Z.J. van de Weg 已提交
204 205 206
# Checks if there is a magic comment to enforce string literals
Style/FrozenStringLiteralComment:
  Enabled: false
207
# Do not introduce global variables.
208
Style/GlobalVars:
209
  Enabled: true
210

211 212
# Prefer Ruby 1.9 hash syntax `{ a: 1, b: 2 }`
# over 1.8 syntax `{ :a => 1, :b => 2 }`.
213
Style/HashSyntax:
214
  Enabled: true
215

216
# Do not use if x; .... Use the ternary operator instead.
217
Style/IfWithSemicolon:
218
  Enabled: true
219

220 221 222
# Checks that conditional statements do not have an identical line at the
# end of each branch, which can validly be moved out of the conditional.
Style/IdenticalConditionalBranches:
223
  Enabled: true
224 225

# Checks the indentation of the first line of the right-hand-side of a
G
Gabriel Mazetto 已提交
226
# multi-line assignment.
227
Style/IndentAssignment:
228
  Enabled: true
229 230

# Keep indentation straight.
231
Style/IndentationConsistency:
232
  Enabled: true
233

234
# Use 2 spaces for indentation.
235
Style/IndentationWidth:
236
  Enabled: true
237

238
# Use Kernel#loop for infinite loops.
239
Style/InfiniteLoop:
240
  Enabled: true
241

242
# Use lambda.call(...) instead of lambda.(...).
243
Style/LambdaCall:
244
  Enabled: true
245

246
# Comments should start with a space.
247
Style/LeadingCommentSpace:
F
Felipe Artur 已提交
248
  Enabled: true
249

250
# Checks if the method definitions have or don't have parentheses.
251
Style/MethodDefParentheses:
252
  Enabled: true
253

254
# Use the configured style when naming methods.
255
Style/MethodName:
256
  Enabled: true
257

C
Connor Shea 已提交
258 259 260 261
# Checks for usage of `extend self` in modules.
Style/ModuleFunction:
  Enabled: false

R
Robert Speicher 已提交
262 263 264 265 266 267
# Checks that the closing brace in an array literal is either on the same line
# as the last array element, or a new line.
Style/MultilineArrayBraceLayout:
  Enabled: false
  EnforcedStyle: symmetrical

268
# Avoid multi-line chains of blocks.
269
Style/MultilineBlockChain:
270
  Enabled: true
271

272
# Ensures newlines after multiline block do statements.
273
Style/MultilineBlockLayout:
274
  Enabled: true
275

R
Robert Speicher 已提交
276 277 278 279 280 281
# Checks that the closing brace in a hash literal is either on the same line as
# the last hash element, or a new line.
Style/MultilineHashBraceLayout:
  Enabled: false
  EnforcedStyle: symmetrical

282
# Do not use then for multi-line if/unless.
283
Style/MultilineIfThen:
284
  Enabled: true
285

R
Robert Speicher 已提交
286 287 288 289 290 291
# Checks that the closing brace in a method call is either on the same line as
# the last method argument, or a new line.
Style/MultilineMethodCallBraceLayout:
  Enabled: false
  EnforcedStyle: symmetrical

292 293 294 295 296
# Checks indentation of method calls with the dot operator that span more than
# one line.
Style/MultilineMethodCallIndentation:
  Enabled: false

297 298 299 300 301
# Checks that the closing brace in a method definition is symmetrical with
# respect to the opening brace and the method parameters.
Style/MultilineMethodDefinitionBraceLayout:
  Enabled: false

302
# Checks indentation of binary operations that span more than one line.
303
Style/MultilineOperationIndentation:
304 305
  Enabled: true
  EnforcedStyle: indented
306

307 308 309 310
# Avoid multi-line `? :` (the ternary operator), use if/unless instead.
Style/MultilineTernaryOperator:
  Enabled: true

D
Douwe Maan 已提交
311 312 313
Style/MutableConstant:
  Enabled: true

314
# Favor unless over if for negative conditions (or control flow or).
315
Style/NegatedIf:
316
  Enabled: true
317

318 319
# Avoid using nested modifiers.
Style/NestedModifier:
320
  Enabled: true
321 322

# Use one expression per branch in a ternary operator.
323
Style/NestedTernaryOperator:
324
  Enabled: true
325

326
# Prefer x.nil? to x == nil.
327
Style/NilComparison:
328
  Enabled: true
329

330
# Checks for redundant nil checks.
331
Style/NonNilCheck:
332
  Enabled: true
333

334
# Use ! instead of not.
335
Style/Not:
336
  Enabled: true
337

338
# Add underscores to large numeric literals to improve their readability.
339 340 341
Style/NumericLiterals:
  Enabled: false

342
# Favor the ternary operator(?:) over if/then/else/end constructs.
343
Style/OneLineConditional:
344
  Enabled: true
345

346
# When defining binary operators, name the argument other.
347
Style/OpMethod:
348
  Enabled: true
349

350
# Don't use parentheses around the condition of an if/unless/while.
351
Style/ParenthesesAroundCondition:
352
  Enabled: true
353

354 355 356 357
# Checks for an obsolete RuntimeException argument in raise/fail.
Style/RedundantException:
  Enabled: true

358 359
# Checks for parentheses that seem not to serve any purpose.
Style/RedundantParentheses:
360
  Enabled: true
361 362

# Don't use semicolons to terminate expressions.
363
Style/Semicolon:
364
  Enabled: true
365

366
# Checks for proper usage of fail and raise.
367
Style/SignalException:
368 369
  EnforcedStyle: only_raise
  Enabled: true
370

371
# Use spaces after colons.
372
Style/SpaceAfterColon:
373
  Enabled: true
374

375
# Use spaces after commas.
376
Style/SpaceAfterComma:
377
  Enabled: true
378

379 380
# Do not put a space between a method name and the opening parenthesis in a
# method definition.
381
Style/SpaceAfterMethodName:
382
  Enabled: true
383

384
# Tracks redundant space after the ! operator.
385
Style/SpaceAfterNot:
386
  Enabled: true
387

388
# Use spaces after semicolons.
389
Style/SpaceAfterSemicolon:
390
  Enabled: true
391

392 393 394 395
# Use space around equals in parameter default
Style/SpaceAroundEqualsInParameterDefault:
  Enabled: true

396 397
# Use a space around keywords if appropriate.
Style/SpaceAroundKeyword:
398
  Enabled: true
399

400 401
# Use a single space around operators.
Style/SpaceAroundOperators:
G
Gabriel Mazetto 已提交
402
  Enabled: true
403

404 405
# No spaces before commas.
Style/SpaceBeforeComma:
406
  Enabled: true
407

408 409
# Checks for missing space between code and a comment on the same line.
Style/SpaceBeforeComment:
410
  Enabled: true
411

412 413
# No spaces before semicolons.
Style/SpaceBeforeSemicolon:
414
  Enabled: true
415

D
Douwe Maan 已提交
416 417 418
Style/SpaceInsideBrackets:
  Enabled: true

419
# Use spaces inside hash literal braces - or don't.
420
Style/SpaceInsideHashLiteralBraces:
421
  Enabled: true
422

423
# No spaces inside range literals.
424
Style/SpaceInsideRangeLiteral:
425
  Enabled: true
426

427 428
# Checks for padding/surrounding spaces inside string interpolation.
Style/SpaceInsideStringInterpolation:
429 430
  EnforcedStyle: no_space
  Enabled: true
431 432 433

# Check for the usage of parentheses around stabby lambda arguments.
Style/StabbyLambdaParentheses:
434 435
  EnforcedStyle: require_parentheses
  Enabled: true
436 437

# Checks if uses of quotes match the configured preference.
438 439 440
Style/StringLiterals:
  Enabled: false

441 442
# Checks if configured preferred methods are used over non-preferred.
Style/StringMethods:
443 444 445
  PreferredMethods:
    intern: to_sym
  Enabled: true
446 447

# No hard tabs.
448
Style/Tab:
D
Dmitriy Zaporozhets 已提交
449
  Enabled: true
450

451
# Checks trailing blank lines and final newline.
452
Style/TrailingBlankLines:
453
  Enabled: true
454

455 456 457
Style/TrailingCommaInLiteral:
  Enabled: false

458
# Checks for %W when interpolation is not needed.
459
Style/UnneededCapitalW:
460
  Enabled: true
461

462
# Checks for %q/%Q when single quotes or double quotes would do.
463 464 465
Style/UnneededPercentQ:
  Enabled: false

466
# Don't interpolate global, instance and class variables directly in strings.
467
Style/VariableInterpolation:
468
  Enabled: true
469

470
# Use the configured style when naming variables.
471
Style/VariableName:
472 473
  EnforcedStyle: snake_case
  Enabled: true
474

475 476 477 478
# Use the configured style when numbering variables.
Style/VariableNumber:
  Enabled: false

479
# Use when x then ... for one-line cases.
480
Style/WhenThen:
481
  Enabled: true
482

483
# Checks for redundant do after while or until.
484
Style/WhileUntilDo:
485
  Enabled: true
486

487
# Favor modifier while/until usage when you have a single-line body.
488
Style/WhileUntilModifier:
489
  Enabled: true
490

491
# Use %w or %W for arrays of words.
492 493 494
Style/WordArray:
  Enabled: false

495
# Metrics #####################################################################
496

497 498
# A calculated magnitude based on number of assignments,
# branches, and conditions.
499
Metrics/AbcSize:
G
Grzegorz Bizon 已提交
500
  Enabled: true
501
  Max: 60
G
Grzegorz Bizon 已提交
502

503
# Avoid excessive block nesting.
504
Metrics/BlockNesting:
G
Grzegorz Bizon 已提交
505 506
  Enabled: true
  Max: 4
507

508
# Avoid classes longer than 100 lines of code.
509 510 511
Metrics/ClassLength:
  Enabled: false

512 513 514 515 516 517 518
# A complexity metric that is strongly correlated to the number
# of test cases needed to validate a method.
Metrics/CyclomaticComplexity:
  Enabled: true
  Max: 17

# Limit lines to 80 characters.
519 520 521
Metrics/LineLength:
  Enabled: false

522
# Avoid methods longer than 10 lines of code.
523 524 525
Metrics/MethodLength:
  Enabled: false

526
# Avoid modules longer than 100 lines of code.
527 528 529
Metrics/ModuleLength:
  Enabled: false

530 531 532 533 534 535 536 537
# Avoid parameter lists longer than three or four parameters.
Metrics/ParameterLists:
  Enabled: true
  Max: 8

# A complexity metric geared towards measuring complexity for a human reader.
Metrics/PerceivedComplexity:
  Enabled: true
V
Valery Sizov 已提交
538
  Max: 18
539

540
# Lint ########################################################################
541

542 543 544 545 546 547 548 549 550
# Checks for useless access modifiers.
Lint/UselessAccessModifier:
  Enabled: true

# Checks for attempts to use `private` or `protected` to set the visibility
# of a class method, which does not work.
Lint/IneffectiveAccessModifier:
  Enabled: false

551 552
# Checks for ambiguous operators in the first argument of a method invocation
# without parentheses.
553
Lint/AmbiguousOperator:
554
  Enabled: true
555

556
# Align block ends correctly.
557
Lint/BlockAlignment:
558
  Enabled: true
559

560 561 562
# Default values in optional keyword arguments and optional ordinal arguments
# should not refer back to the name of the argument.
Lint/CircularArgumentReference:
563
  Enabled: true
564 565

# Checks for condition placed in a confusing position relative to the keyword.
566
Lint/ConditionPosition:
567
  Enabled: true
568

569
# Check for debugger calls.
570
Lint/Debugger:
571
  Enabled: true
572

573
# Align ends corresponding to defs correctly.
574
Lint/DefEndAlignment:
575
  Enabled: true
576

577
# Check for deprecated class method calls.
578
Lint/DeprecatedClassMethods:
579
  Enabled: true
580

581 582
# Check for immutable argument given to each_with_object.
Lint/EachWithObjectArgument:
583
  Enabled: true
584 585

# Check for odd code arrangement in an else block.
586
Lint/ElseLayout:
587
  Enabled: true
588

589
# Checks for empty ensure block.
590
Lint/EmptyEnsure:
591
  Enabled: true
592

593 594 595 596
# Checks for the presence of `when` branches without a body.
Lint/EmptyWhen:
  Enabled: true

597
# Align ends correctly.
598
Lint/EndAlignment:
599
  Enabled: true
600

601
# END blocks should not be placed inside method definitions.
602
Lint/EndInMethod:
603
  Enabled: true
604

605
# Do not use return in an ensure block.
606
Lint/EnsureReturn:
607
  Enabled: true
608

609
# The use of eval represents a serious security risk.
610
Lint/Eval:
611
  Enabled: true
612

613 614
# Catches floating-point literals too large or small for Ruby to represent.
Lint/FloatOutOfRange:
615
  Enabled: true
616 617 618

# The number of parameters to format/sprint must match the fields.
Lint/FormatParameterMismatch:
619
  Enabled: true
620 621 622 623

# Checks for adjacent string literals on the same line, which could better be
# represented as a single string literal.
Lint/ImplicitStringConcatenation:
624
  Enabled: true
625 626 627

# Checks for invalid character literals with a non-escaped whitespace
# character.
628
Lint/InvalidCharacterLiteral:
629
  Enabled: true
630

631
# Checks of literals used in conditions.
632
Lint/LiteralInCondition:
633
  Enabled: true
634

635
# Checks for literals used in interpolation.
636
Lint/LiteralInInterpolation:
637
  Enabled: true
638

639 640
# Do not use nested method definitions.
Lint/NestedMethodDefinition:
641
  Enabled: true
642 643 644

# Do not omit the accumulator when calling `next` in a `reduce`/`inject` block.
Lint/NextWithoutAccumulator:
645
  Enabled: true
646 647

# Checks for method calls with a space before the opening parenthesis.
648
Lint/ParenthesesAsGroupedExpression:
649
  Enabled: true
650

651 652 653
# Checks for `rand(1)` calls. Such calls always return `0` and most likely
# a mistake.
Lint/RandOne:
654
  Enabled: true
655 656

# Use parentheses in the method call to avoid confusion about precedence.
657
Lint/RequireParentheses:
658
  Enabled: true
659

660
# Avoid rescuing the Exception class.
661
Lint/RescueException:
662
  Enabled: true
663

C
Connor Shea 已提交
664 665
# Checks for the order which exceptions are rescued to avoid rescueing a less specific exception before a more specific exception.
Lint/ShadowedException:
666 667
  Enabled: false

668 669 670 671
# Checks for Object#to_s usage in string interpolation.
Lint/StringConversionInInterpolation:
  Enabled: true

672
# Do not use prefix `_` for a variable that is used.
673
Lint/UnderscorePrefixedVariableName:
674
  Enabled: true
675

676 677 678 679 680 681 682
# Checks for rubocop:disable comments that can be removed.
# Note: this cop is not disabled when disabling all cops.
# It must be explicitly disabled.
Lint/UnneededDisable:
  Enabled: false

# Unreachable code.
683
Lint/UnreachableCode:
684
  Enabled: true
685

D
Douwe Maan 已提交
686 687 688
Lint/UnusedMethodArgument:
  Enabled: false

689
# Checks for useless assignment to a local variable.
690
Lint/UselessAssignment:
691
  Enabled: true
692

693
# Checks for comparison of something with itself.
694
Lint/UselessComparison:
695
  Enabled: true
696

697
# Checks for useless `else` in `begin..end` without `rescue`.
698
Lint/UselessElseWithoutRescue:
699
  Enabled: true
700

701
# Checks for useless setter call to a local variable.
702
Lint/UselessSetterCall:
703
  Enabled: true
704

705
# Possible use of operator/literal/variable in void context.
706
Lint/Void:
707
  Enabled: true
708

709
# Performance #################################################################
710 711 712

# Use `casecmp` rather than `downcase ==`.
Performance/Casecmp:
713
  Enabled: true
714 715 716 717

# Use `str.{start,end}_with?(x, ..., y, ...)` instead of
# `str.{start,end}_with?(x, ...) || str.{start,end}_with?(y, ...)`.
Performance/DoubleStartEndWith:
718
  Enabled: true
719 720 721

# Use `strip` instead of `lstrip.rstrip`.
Performance/LstripRstrip:
C
Connor Shea 已提交
722
  Enabled: true
723 724 725

# Use `Range#cover?` instead of `Range#include?`.
Performance/RangeInclude:
726
  Enabled: true
727 728 729

# Use `sort` instead of `sort_by { |x| x }`.
Performance/RedundantSortBy:
730
  Enabled: true
731 732 733 734

# Use `start_with?` instead of a regex match anchored to the beginning of a
# string.
Performance/StartWith:
735
  Enabled: true
C
Connor Shea 已提交
736

737 738 739 740
# Use `tr` instead of `gsub` when you are replacing the same number of
# characters. Use `delete` instead of `gsub` when you are deleting
# characters.
Performance/StringReplacement:
C
Connor Shea 已提交
741
  Enabled: true
742 743 744

# Checks for `.times.map` calls.
Performance/TimesMap:
745
  Enabled: true
746

747
# Rails #######################################################################
748

749 750 751 752 753
# Enables Rails cops.
Rails:
  Enabled: true

# Enforces consistent use of action filter methods.
754
Rails/ActionFilter:
755
  Enabled: true
756
  EnforcedStyle: action
757

758 759
# Checks the correct usage of date aware methods, such as `Date.today`,
# `Date.current`, etc.
G
Gabriel Mazetto 已提交
760 761 762
Rails/Date:
  Enabled: false

763 764
# Prefer delegate method for delegations.
Rails/Delegate:
765 766
  Enabled: false

767 768
# Prefer `find_by` over `where.first`.
Rails/FindBy:
769
  Enabled: true
770 771 772

# Prefer `all.find_each` over `all.find`.
Rails/FindEach:
773
  Enabled: true
774

775
# Prefer has_many :through to has_and_belongs_to_many.
776
Rails/HasAndBelongsToMany:
777
  Enabled: true
778

779
# Checks for calls to puts, print, etc.
780
Rails/Output:
781
  Enabled: true
782

783 784
# Checks for incorrect grammar when using methods like `3.day.ago`.
Rails/PluralizationGrammar:
785
  Enabled: true
786 787

# Checks for `read_attribute(:attr)` and `write_attribute(:attr, val)`.
788 789 790
Rails/ReadWriteAttribute:
  Enabled: false

791
# Checks the arguments of ActiveRecord scopes.
792
Rails/ScopeArgs:
793
  Enabled: true
794

795
# RSpec #######################################################################
R
Robert Speicher 已提交
796

797
# Check that instances are not being stubbed globally.
R
Robert Speicher 已提交
798 799 800
RSpec/AnyInstance:
  Enabled: false

801 802 803 804
# Check for expectations where `be(...)` can replace `eql(...)`.
RSpec/BeEql:
  Enabled: false

805 806
# Check that the first argument to the top level describe is the tested class or
# module.
R
Robert Speicher 已提交
807 808 809
RSpec/DescribeClass:
  Enabled: false

810
# Use `described_class` for tested class / module.
R
Robert Speicher 已提交
811 812 813
RSpec/DescribeMethod:
  Enabled: false

814 815 816
# Checks that the second argument to top level describe is the tested method
# name.
RSpec/DescribedClass:
R
Robert Speicher 已提交
817 818
  Enabled: false

819
# Checks for long example.
R
Robert Speicher 已提交
820 821 822 823
RSpec/ExampleLength:
  Enabled: false
  Max: 5

824
# Do not use should when describing your tests.
R
Robert Speicher 已提交
825 826 827 828 829 830 831 832
RSpec/ExampleWording:
  Enabled: false
  CustomTransform:
    be: is
    have: has
    not: does not
  IgnoredWords: []

833 834 835 836
# Checks for `expect(...)` calls containing literal values.
RSpec/ExpectActual:
  Enabled: true

837
# Checks the file and folder naming of the spec file.
R
Robert Speicher 已提交
838 839 840 841 842 843
RSpec/FilePath:
  Enabled: false
  CustomTransform:
    RuboCop: rubocop
    RSpec: rspec

844
# Checks if there are focused specs.
R
Robert Speicher 已提交
845 846 847
RSpec/Focus:
  Enabled: true

848
# Checks for the usage of instance variables.
R
Robert Speicher 已提交
849 850 851
RSpec/InstanceVariable:
  Enabled: false

852
# Checks for multiple top-level describes.
R
Robert Speicher 已提交
853 854 855
RSpec/MultipleDescribes:
  Enabled: false

856
# Enforces the usage of the same method on all negative message expectations.
R
Robert Speicher 已提交
857 858
RSpec/NotToNot:
  EnforcedStyle: not_to
859
  Enabled: true
R
Robert Speicher 已提交
860

861
# Prefer using verifying doubles over normal doubles.
R
Robert Speicher 已提交
862 863
RSpec/VerifiedDoubles:
  Enabled: false
D
Douwe Maan 已提交
864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890

RSpec/MultipleExpectations:
  Enabled: false

RSpec/NamedSubject:
  Enabled: false

RSpec/NestedGroups:
  Enabled: false

RSpec/LeadingSubject:
  Enabled: false

RSpec/LetSetup:
  Enabled: false

RSpec/MessageChain:
  Enabled: false

RSpec/MessageSpies:
  Enabled: false

RSpec/RepeatedDescription:
  Enabled: false

RSpec/SubjectStub:
  Enabled: false