.rubocop.yml 20.2 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

416
# Use spaces inside hash literal braces - or don't.
417
Style/SpaceInsideHashLiteralBraces:
418
  Enabled: true
419

420
# No spaces inside range literals.
421
Style/SpaceInsideRangeLiteral:
422
  Enabled: true
423

424 425
# Checks for padding/surrounding spaces inside string interpolation.
Style/SpaceInsideStringInterpolation:
426 427
  EnforcedStyle: no_space
  Enabled: true
428 429 430

# Check for the usage of parentheses around stabby lambda arguments.
Style/StabbyLambdaParentheses:
431 432
  EnforcedStyle: require_parentheses
  Enabled: true
433 434

# Checks if uses of quotes match the configured preference.
435 436 437
Style/StringLiterals:
  Enabled: false

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

# No hard tabs.
445
Style/Tab:
D
Dmitriy Zaporozhets 已提交
446
  Enabled: true
447

448
# Checks trailing blank lines and final newline.
449
Style/TrailingBlankLines:
450
  Enabled: true
451

452
# Checks for %W when interpolation is not needed.
453
Style/UnneededCapitalW:
454
  Enabled: true
455

456
# Checks for %q/%Q when single quotes or double quotes would do.
457 458 459
Style/UnneededPercentQ:
  Enabled: false

460
# Don't interpolate global, instance and class variables directly in strings.
461
Style/VariableInterpolation:
462
  Enabled: true
463

464
# Use the configured style when naming variables.
465
Style/VariableName:
466 467
  EnforcedStyle: snake_case
  Enabled: true
468

469 470 471 472
# Use the configured style when numbering variables.
Style/VariableNumber:
  Enabled: false

473
# Use when x then ... for one-line cases.
474
Style/WhenThen:
475
  Enabled: true
476

477
# Checks for redundant do after while or until.
478
Style/WhileUntilDo:
479
  Enabled: true
480

481
# Favor modifier while/until usage when you have a single-line body.
482
Style/WhileUntilModifier:
483
  Enabled: true
484

485
# Use %w or %W for arrays of words.
486 487 488
Style/WordArray:
  Enabled: false

489
# Metrics #####################################################################
490

491 492
# A calculated magnitude based on number of assignments,
# branches, and conditions.
493
Metrics/AbcSize:
G
Grzegorz Bizon 已提交
494
  Enabled: true
495
  Max: 60
G
Grzegorz Bizon 已提交
496

497
# Avoid excessive block nesting.
498
Metrics/BlockNesting:
G
Grzegorz Bizon 已提交
499 500
  Enabled: true
  Max: 4
501

502
# Avoid classes longer than 100 lines of code.
503 504 505
Metrics/ClassLength:
  Enabled: false

506 507 508 509 510 511 512
# 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.
513 514 515
Metrics/LineLength:
  Enabled: false

516
# Avoid methods longer than 10 lines of code.
517 518 519
Metrics/MethodLength:
  Enabled: false

520
# Avoid modules longer than 100 lines of code.
521 522 523
Metrics/ModuleLength:
  Enabled: false

524 525 526 527 528 529 530 531
# 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 已提交
532
  Max: 18
533

534
# Lint ########################################################################
535

536 537 538 539 540 541 542 543 544
# 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

545 546
# Checks for ambiguous operators in the first argument of a method invocation
# without parentheses.
547
Lint/AmbiguousOperator:
548
  Enabled: true
549

550
# Align block ends correctly.
551
Lint/BlockAlignment:
552
  Enabled: true
553

554 555 556
# Default values in optional keyword arguments and optional ordinal arguments
# should not refer back to the name of the argument.
Lint/CircularArgumentReference:
557
  Enabled: true
558 559

# Checks for condition placed in a confusing position relative to the keyword.
560
Lint/ConditionPosition:
561
  Enabled: true
562

563
# Check for debugger calls.
564
Lint/Debugger:
565
  Enabled: true
566

567
# Align ends corresponding to defs correctly.
568
Lint/DefEndAlignment:
569
  Enabled: true
570

571
# Check for deprecated class method calls.
572
Lint/DeprecatedClassMethods:
573
  Enabled: true
574

575 576
# Check for immutable argument given to each_with_object.
Lint/EachWithObjectArgument:
577
  Enabled: true
578 579

# Check for odd code arrangement in an else block.
580
Lint/ElseLayout:
581
  Enabled: true
582

583
# Checks for empty ensure block.
584
Lint/EmptyEnsure:
585
  Enabled: true
586

587 588 589 590
# Checks for the presence of `when` branches without a body.
Lint/EmptyWhen:
  Enabled: true

591
# Align ends correctly.
592
Lint/EndAlignment:
593
  Enabled: true
594

595
# END blocks should not be placed inside method definitions.
596
Lint/EndInMethod:
597
  Enabled: true
598

599
# Do not use return in an ensure block.
600
Lint/EnsureReturn:
601
  Enabled: true
602

603
# The use of eval represents a serious security risk.
604
Lint/Eval:
605
  Enabled: true
606

607 608
# Catches floating-point literals too large or small for Ruby to represent.
Lint/FloatOutOfRange:
609
  Enabled: true
610 611 612

# The number of parameters to format/sprint must match the fields.
Lint/FormatParameterMismatch:
613
  Enabled: true
614 615 616 617

# Checks for adjacent string literals on the same line, which could better be
# represented as a single string literal.
Lint/ImplicitStringConcatenation:
618
  Enabled: true
619 620 621

# Checks for invalid character literals with a non-escaped whitespace
# character.
622
Lint/InvalidCharacterLiteral:
623
  Enabled: true
624

625
# Checks of literals used in conditions.
626
Lint/LiteralInCondition:
627
  Enabled: true
628

629
# Checks for literals used in interpolation.
630
Lint/LiteralInInterpolation:
631
  Enabled: true
632

633 634
# Do not use nested method definitions.
Lint/NestedMethodDefinition:
635
  Enabled: true
636 637 638

# Do not omit the accumulator when calling `next` in a `reduce`/`inject` block.
Lint/NextWithoutAccumulator:
639
  Enabled: true
640 641

# Checks for method calls with a space before the opening parenthesis.
642
Lint/ParenthesesAsGroupedExpression:
643
  Enabled: true
644

645 646 647
# Checks for `rand(1)` calls. Such calls always return `0` and most likely
# a mistake.
Lint/RandOne:
648
  Enabled: true
649 650

# Use parentheses in the method call to avoid confusion about precedence.
651
Lint/RequireParentheses:
652
  Enabled: true
653

654
# Avoid rescuing the Exception class.
655
Lint/RescueException:
656
  Enabled: true
657

C
Connor Shea 已提交
658 659
# Checks for the order which exceptions are rescued to avoid rescueing a less specific exception before a more specific exception.
Lint/ShadowedException:
660 661
  Enabled: false

662 663 664 665
# Checks for Object#to_s usage in string interpolation.
Lint/StringConversionInInterpolation:
  Enabled: true

666
# Do not use prefix `_` for a variable that is used.
667
Lint/UnderscorePrefixedVariableName:
668
  Enabled: true
669

670 671 672 673 674 675 676
# 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.
677
Lint/UnreachableCode:
678
  Enabled: true
679

680
# Checks for useless assignment to a local variable.
681
Lint/UselessAssignment:
682
  Enabled: true
683

684
# Checks for comparison of something with itself.
685
Lint/UselessComparison:
686
  Enabled: true
687

688
# Checks for useless `else` in `begin..end` without `rescue`.
689
Lint/UselessElseWithoutRescue:
690
  Enabled: true
691

692
# Checks for useless setter call to a local variable.
693
Lint/UselessSetterCall:
694
  Enabled: true
695

696
# Possible use of operator/literal/variable in void context.
697
Lint/Void:
698
  Enabled: true
699

700
# Performance #################################################################
701 702 703

# Use `casecmp` rather than `downcase ==`.
Performance/Casecmp:
704
  Enabled: true
705 706 707 708

# Use `str.{start,end}_with?(x, ..., y, ...)` instead of
# `str.{start,end}_with?(x, ...) || str.{start,end}_with?(y, ...)`.
Performance/DoubleStartEndWith:
709
  Enabled: true
710 711 712

# Use `strip` instead of `lstrip.rstrip`.
Performance/LstripRstrip:
C
Connor Shea 已提交
713
  Enabled: true
714 715 716

# Use `Range#cover?` instead of `Range#include?`.
Performance/RangeInclude:
717
  Enabled: true
718 719 720

# Use `sort` instead of `sort_by { |x| x }`.
Performance/RedundantSortBy:
721
  Enabled: true
722 723 724 725

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

728 729 730 731
# 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 已提交
732
  Enabled: true
733 734 735

# Checks for `.times.map` calls.
Performance/TimesMap:
736
  Enabled: true
737

738
# Rails #######################################################################
739

740 741 742 743 744
# Enables Rails cops.
Rails:
  Enabled: true

# Enforces consistent use of action filter methods.
745
Rails/ActionFilter:
746
  Enabled: true
747
  EnforcedStyle: action
748

749 750
# Checks the correct usage of date aware methods, such as `Date.today`,
# `Date.current`, etc.
G
Gabriel Mazetto 已提交
751 752 753
Rails/Date:
  Enabled: false

754 755
# Prefer delegate method for delegations.
Rails/Delegate:
756 757
  Enabled: false

758 759
# Prefer `find_by` over `where.first`.
Rails/FindBy:
760
  Enabled: true
761 762 763

# Prefer `all.find_each` over `all.find`.
Rails/FindEach:
764
  Enabled: true
765

766
# Prefer has_many :through to has_and_belongs_to_many.
767
Rails/HasAndBelongsToMany:
768
  Enabled: true
769

770
# Checks for calls to puts, print, etc.
771
Rails/Output:
772
  Enabled: true
773

774 775
# Checks for incorrect grammar when using methods like `3.day.ago`.
Rails/PluralizationGrammar:
776
  Enabled: true
777 778

# Checks for `read_attribute(:attr)` and `write_attribute(:attr, val)`.
779 780 781
Rails/ReadWriteAttribute:
  Enabled: false

782
# Checks the arguments of ActiveRecord scopes.
783
Rails/ScopeArgs:
784
  Enabled: true
785

786
# RSpec #######################################################################
R
Robert Speicher 已提交
787

788
# Check that instances are not being stubbed globally.
R
Robert Speicher 已提交
789 790 791
RSpec/AnyInstance:
  Enabled: false

792 793 794 795
# Check for expectations where `be(...)` can replace `eql(...)`.
RSpec/BeEql:
  Enabled: false

796 797
# Check that the first argument to the top level describe is the tested class or
# module.
R
Robert Speicher 已提交
798 799 800
RSpec/DescribeClass:
  Enabled: false

801
# Use `described_class` for tested class / module.
R
Robert Speicher 已提交
802 803 804
RSpec/DescribeMethod:
  Enabled: false

805 806 807
# Checks that the second argument to top level describe is the tested method
# name.
RSpec/DescribedClass:
R
Robert Speicher 已提交
808 809
  Enabled: false

810
# Checks for long example.
R
Robert Speicher 已提交
811 812 813 814
RSpec/ExampleLength:
  Enabled: false
  Max: 5

815
# Do not use should when describing your tests.
R
Robert Speicher 已提交
816 817 818 819 820 821 822 823
RSpec/ExampleWording:
  Enabled: false
  CustomTransform:
    be: is
    have: has
    not: does not
  IgnoredWords: []

824 825 826 827
# Checks for `expect(...)` calls containing literal values.
RSpec/ExpectActual:
  Enabled: true

828
# Checks the file and folder naming of the spec file.
R
Robert Speicher 已提交
829 830 831 832 833 834
RSpec/FilePath:
  Enabled: false
  CustomTransform:
    RuboCop: rubocop
    RSpec: rspec

835
# Checks if there are focused specs.
R
Robert Speicher 已提交
836 837 838
RSpec/Focus:
  Enabled: true

839
# Checks for the usage of instance variables.
R
Robert Speicher 已提交
840 841 842
RSpec/InstanceVariable:
  Enabled: false

843
# Checks for multiple top-level describes.
R
Robert Speicher 已提交
844 845 846
RSpec/MultipleDescribes:
  Enabled: false

847
# Enforces the usage of the same method on all negative message expectations.
R
Robert Speicher 已提交
848 849
RSpec/NotToNot:
  EnforcedStyle: not_to
850
  Enabled: true
R
Robert Speicher 已提交
851

852
# Prefer using verifying doubles over normal doubles.
R
Robert Speicher 已提交
853 854
RSpec/VerifiedDoubles:
  Enabled: false
855 856 857 858 859 860

# Custom ######################################################################

# Disallow the `git` and `github` arguments in the Gemfile.
GemFetcher:
  Enabled: true