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

139
# Align elses and elsifs correctly.
140
Style/ElseAlignment:
141
  Enabled: true
142

143
# Use empty lines between defs.
144 145 146
Style/EmptyLineBetweenDefs:
  Enabled: false

147
# Don't use several empty lines in a row.
148
Style/EmptyLines:
149
  Enabled: true
150

151
# Keep blank lines around access modifiers.
152
Style/EmptyLinesAroundAccessModifier:
153
  Enabled: true
154

155
# Keeps track of empty lines around block bodies.
156
Style/EmptyLinesAroundBlockBody:
157
  Enabled: true
158

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

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

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

171
# Avoid the use of END blocks.
172
Style/EndBlock:
173
  Enabled: true
174

175
# Use Unix-style line endings.
176
Style/EndOfLine:
177
  Enabled: true
178

179
# Favor the use of Fixnum#even? && Fixnum#odd?
180
Style/EvenOdd:
181
  Enabled: true
182

183
# Use snake_case for source file names.
184
Style/FileName:
185 186 187
  Enabled: true

# Checks for a line break before the first parameter in a multi-line method
188
# parameter definition.
189 190
Style/FirstMethodParameterLineBreak:
  Enabled: true
191

192
# Checks for flip flops.
193
Style/FlipFlop:
194
  Enabled: true
195

196
# Checks use of for or each in multiline loops.
197
Style/For:
G
Grzegorz Bizon 已提交
198
  Enabled: true
199

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

207 208
# Prefer Ruby 1.9 hash syntax `{ a: 1, b: 2 }`
# over 1.8 syntax `{ :a => 1, :b => 2 }`.
209
Style/HashSyntax:
210
  Enabled: true
211

212
# Do not use if x; .... Use the ternary operator instead.
213
Style/IfWithSemicolon:
214
  Enabled: true
215

216 217 218
# 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:
219
  Enabled: true
220 221

# Checks the indentation of the first line of the right-hand-side of a
G
Gabriel Mazetto 已提交
222
# multi-line assignment.
223
Style/IndentAssignment:
224
  Enabled: true
225 226

# Keep indentation straight.
227
Style/IndentationConsistency:
228
  Enabled: true
229

230
# Use 2 spaces for indentation.
231
Style/IndentationWidth:
232
  Enabled: true
233

234
# Use Kernel#loop for infinite loops.
235
Style/InfiniteLoop:
236
  Enabled: true
237

238
# Use lambda.call(...) instead of lambda.(...).
239
Style/LambdaCall:
240
  Enabled: true
241

242
# Comments should start with a space.
243
Style/LeadingCommentSpace:
F
Felipe Artur 已提交
244
  Enabled: true
245

246
# Checks if the method definitions have or don't have parentheses.
247
Style/MethodDefParentheses:
248
  Enabled: true
249

250
# Use the configured style when naming methods.
251
Style/MethodName:
252
  Enabled: true
253

C
Connor Shea 已提交
254 255 256 257
# Checks for usage of `extend self` in modules.
Style/ModuleFunction:
  Enabled: false

R
Robert Speicher 已提交
258 259 260 261 262 263
# 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

264
# Avoid multi-line chains of blocks.
265
Style/MultilineBlockChain:
266
  Enabled: true
267

268
# Ensures newlines after multiline block do statements.
269
Style/MultilineBlockLayout:
270
  Enabled: true
271

R
Robert Speicher 已提交
272 273 274 275 276 277
# 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

278
# Do not use then for multi-line if/unless.
279
Style/MultilineIfThen:
280
  Enabled: true
281

R
Robert Speicher 已提交
282 283 284 285 286 287
# 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

288 289 290 291 292
# Checks indentation of method calls with the dot operator that span more than
# one line.
Style/MultilineMethodCallIndentation:
  Enabled: false

293 294 295 296 297
# 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

298
# Checks indentation of binary operations that span more than one line.
299
Style/MultilineOperationIndentation:
300 301
  Enabled: true
  EnforcedStyle: indented
302

303 304 305 306
# Avoid multi-line `? :` (the ternary operator), use if/unless instead.
Style/MultilineTernaryOperator:
  Enabled: true

307
# Favor unless over if for negative conditions (or control flow or).
308
Style/NegatedIf:
309
  Enabled: true
310

311 312
# Avoid using nested modifiers.
Style/NestedModifier:
313
  Enabled: true
314 315

# Use one expression per branch in a ternary operator.
316
Style/NestedTernaryOperator:
317
  Enabled: true
318

319
# Prefer x.nil? to x == nil.
320
Style/NilComparison:
321
  Enabled: true
322

323
# Checks for redundant nil checks.
324
Style/NonNilCheck:
325
  Enabled: true
326

327
# Use ! instead of not.
328
Style/Not:
329
  Enabled: true
330

331
# Add underscores to large numeric literals to improve their readability.
332 333 334
Style/NumericLiterals:
  Enabled: false

335
# Favor the ternary operator(?:) over if/then/else/end constructs.
336
Style/OneLineConditional:
337
  Enabled: true
338

339
# When defining binary operators, name the argument other.
340
Style/OpMethod:
341
  Enabled: true
342

343
# Don't use parentheses around the condition of an if/unless/while.
344
Style/ParenthesesAroundCondition:
345
  Enabled: true
346

347 348 349 350
# Checks for an obsolete RuntimeException argument in raise/fail.
Style/RedundantException:
  Enabled: true

351 352
# Checks for parentheses that seem not to serve any purpose.
Style/RedundantParentheses:
353
  Enabled: true
354 355

# Don't use semicolons to terminate expressions.
356
Style/Semicolon:
357
  Enabled: true
358

359
# Checks for proper usage of fail and raise.
360
Style/SignalException:
361 362
  EnforcedStyle: only_raise
  Enabled: true
363

364
# Use spaces after colons.
365
Style/SpaceAfterColon:
366
  Enabled: true
367

368
# Use spaces after commas.
369
Style/SpaceAfterComma:
370
  Enabled: true
371

372 373
# Do not put a space between a method name and the opening parenthesis in a
# method definition.
374
Style/SpaceAfterMethodName:
375
  Enabled: true
376

377
# Tracks redundant space after the ! operator.
378
Style/SpaceAfterNot:
379
  Enabled: true
380

381
# Use spaces after semicolons.
382
Style/SpaceAfterSemicolon:
383
  Enabled: true
384

385 386 387 388
# Use space around equals in parameter default
Style/SpaceAroundEqualsInParameterDefault:
  Enabled: true

389 390
# Use a space around keywords if appropriate.
Style/SpaceAroundKeyword:
391
  Enabled: true
392

393 394
# Use a single space around operators.
Style/SpaceAroundOperators:
G
Gabriel Mazetto 已提交
395
  Enabled: true
396

397 398
# No spaces before commas.
Style/SpaceBeforeComma:
399
  Enabled: true
400

401 402
# Checks for missing space between code and a comment on the same line.
Style/SpaceBeforeComment:
403
  Enabled: true
404

405 406
# No spaces before semicolons.
Style/SpaceBeforeSemicolon:
407
  Enabled: true
408

409
# Use spaces inside hash literal braces - or don't.
410
Style/SpaceInsideHashLiteralBraces:
411
  Enabled: true
412

413
# No spaces inside range literals.
414
Style/SpaceInsideRangeLiteral:
415
  Enabled: true
416

417 418
# Checks for padding/surrounding spaces inside string interpolation.
Style/SpaceInsideStringInterpolation:
419 420
  EnforcedStyle: no_space
  Enabled: true
421 422 423

# Check for the usage of parentheses around stabby lambda arguments.
Style/StabbyLambdaParentheses:
424 425
  EnforcedStyle: require_parentheses
  Enabled: true
426 427

# Checks if uses of quotes match the configured preference.
428 429 430
Style/StringLiterals:
  Enabled: false

431 432
# Checks if configured preferred methods are used over non-preferred.
Style/StringMethods:
433 434 435
  PreferredMethods:
    intern: to_sym
  Enabled: true
436 437

# No hard tabs.
438
Style/Tab:
D
Dmitriy Zaporozhets 已提交
439
  Enabled: true
440

441
# Checks trailing blank lines and final newline.
442
Style/TrailingBlankLines:
443
  Enabled: true
444

445
# Checks for %W when interpolation is not needed.
446
Style/UnneededCapitalW:
447
  Enabled: true
448

449
# Checks for %q/%Q when single quotes or double quotes would do.
450 451 452
Style/UnneededPercentQ:
  Enabled: false

453
# Don't interpolate global, instance and class variables directly in strings.
454
Style/VariableInterpolation:
455
  Enabled: true
456

457
# Use the configured style when naming variables.
458
Style/VariableName:
459 460
  EnforcedStyle: snake_case
  Enabled: true
461

462 463 464 465
# Use the configured style when numbering variables.
Style/VariableNumber:
  Enabled: false

466
# Use when x then ... for one-line cases.
467
Style/WhenThen:
468
  Enabled: true
469

470
# Checks for redundant do after while or until.
471
Style/WhileUntilDo:
472
  Enabled: true
473

474
# Favor modifier while/until usage when you have a single-line body.
475
Style/WhileUntilModifier:
476
  Enabled: true
477

478
# Use %w or %W for arrays of words.
479 480 481
Style/WordArray:
  Enabled: false

482
# Metrics #####################################################################
483

484 485
# A calculated magnitude based on number of assignments,
# branches, and conditions.
486
Metrics/AbcSize:
G
Grzegorz Bizon 已提交
487
  Enabled: true
488
  Max: 60
G
Grzegorz Bizon 已提交
489

490
# Avoid excessive block nesting.
491
Metrics/BlockNesting:
G
Grzegorz Bizon 已提交
492 493
  Enabled: true
  Max: 4
494

495
# Avoid classes longer than 100 lines of code.
496 497 498
Metrics/ClassLength:
  Enabled: false

499 500 501 502 503 504 505
# 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.
506 507 508
Metrics/LineLength:
  Enabled: false

509
# Avoid methods longer than 10 lines of code.
510 511 512
Metrics/MethodLength:
  Enabled: false

513
# Avoid modules longer than 100 lines of code.
514 515 516
Metrics/ModuleLength:
  Enabled: false

517 518 519 520 521 522 523 524
# 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 已提交
525
  Max: 18
526

527
# Lint ########################################################################
528

529 530 531 532 533 534 535 536 537
# 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

538 539
# Checks for ambiguous operators in the first argument of a method invocation
# without parentheses.
540
Lint/AmbiguousOperator:
541
  Enabled: true
542

543
# Align block ends correctly.
544
Lint/BlockAlignment:
545
  Enabled: true
546

547 548 549
# Default values in optional keyword arguments and optional ordinal arguments
# should not refer back to the name of the argument.
Lint/CircularArgumentReference:
550
  Enabled: true
551 552

# Checks for condition placed in a confusing position relative to the keyword.
553
Lint/ConditionPosition:
554
  Enabled: true
555

556
# Check for debugger calls.
557
Lint/Debugger:
558
  Enabled: true
559

560
# Align ends corresponding to defs correctly.
561
Lint/DefEndAlignment:
562
  Enabled: true
563

564
# Check for deprecated class method calls.
565
Lint/DeprecatedClassMethods:
566
  Enabled: true
567

568 569
# Check for immutable argument given to each_with_object.
Lint/EachWithObjectArgument:
570
  Enabled: true
571 572

# Check for odd code arrangement in an else block.
573
Lint/ElseLayout:
574
  Enabled: true
575

576
# Checks for empty ensure block.
577
Lint/EmptyEnsure:
578
  Enabled: true
579

580 581 582 583
# Checks for the presence of `when` branches without a body.
Lint/EmptyWhen:
  Enabled: true

584
# Align ends correctly.
585
Lint/EndAlignment:
586
  Enabled: true
587

588
# END blocks should not be placed inside method definitions.
589
Lint/EndInMethod:
590
  Enabled: true
591

592
# Do not use return in an ensure block.
593
Lint/EnsureReturn:
594
  Enabled: true
595

596
# The use of eval represents a serious security risk.
597
Lint/Eval:
598
  Enabled: true
599

600 601
# Catches floating-point literals too large or small for Ruby to represent.
Lint/FloatOutOfRange:
602
  Enabled: true
603 604 605

# The number of parameters to format/sprint must match the fields.
Lint/FormatParameterMismatch:
606
  Enabled: true
607 608 609 610

# Checks for adjacent string literals on the same line, which could better be
# represented as a single string literal.
Lint/ImplicitStringConcatenation:
611
  Enabled: true
612 613 614

# Checks for invalid character literals with a non-escaped whitespace
# character.
615
Lint/InvalidCharacterLiteral:
616
  Enabled: true
617

618
# Checks of literals used in conditions.
619
Lint/LiteralInCondition:
620
  Enabled: true
621

622
# Checks for literals used in interpolation.
623
Lint/LiteralInInterpolation:
624
  Enabled: true
625

626 627
# Do not use nested method definitions.
Lint/NestedMethodDefinition:
628
  Enabled: true
629 630 631

# Do not omit the accumulator when calling `next` in a `reduce`/`inject` block.
Lint/NextWithoutAccumulator:
632
  Enabled: true
633 634

# Checks for method calls with a space before the opening parenthesis.
635
Lint/ParenthesesAsGroupedExpression:
636
  Enabled: true
637

638 639 640
# Checks for `rand(1)` calls. Such calls always return `0` and most likely
# a mistake.
Lint/RandOne:
641
  Enabled: true
642 643

# Use parentheses in the method call to avoid confusion about precedence.
644
Lint/RequireParentheses:
645
  Enabled: true
646

647
# Avoid rescuing the Exception class.
648
Lint/RescueException:
649
  Enabled: true
650

C
Connor Shea 已提交
651 652
# Checks for the order which exceptions are rescued to avoid rescueing a less specific exception before a more specific exception.
Lint/ShadowedException:
653 654
  Enabled: false

655 656 657 658
# Checks for Object#to_s usage in string interpolation.
Lint/StringConversionInInterpolation:
  Enabled: true

659
# Do not use prefix `_` for a variable that is used.
660
Lint/UnderscorePrefixedVariableName:
661
  Enabled: true
662

663 664 665 666 667 668 669
# 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.
670
Lint/UnreachableCode:
671
  Enabled: true
672

673
# Checks for useless assignment to a local variable.
674
Lint/UselessAssignment:
675
  Enabled: true
676

677
# Checks for comparison of something with itself.
678
Lint/UselessComparison:
679
  Enabled: true
680

681
# Checks for useless `else` in `begin..end` without `rescue`.
682
Lint/UselessElseWithoutRescue:
683
  Enabled: true
684

685
# Checks for useless setter call to a local variable.
686
Lint/UselessSetterCall:
687
  Enabled: true
688

689
# Possible use of operator/literal/variable in void context.
690
Lint/Void:
691
  Enabled: true
692

693
# Performance #################################################################
694 695 696

# Use `casecmp` rather than `downcase ==`.
Performance/Casecmp:
697
  Enabled: true
698 699 700 701

# Use `str.{start,end}_with?(x, ..., y, ...)` instead of
# `str.{start,end}_with?(x, ...) || str.{start,end}_with?(y, ...)`.
Performance/DoubleStartEndWith:
702
  Enabled: true
703 704 705

# Use `strip` instead of `lstrip.rstrip`.
Performance/LstripRstrip:
C
Connor Shea 已提交
706
  Enabled: true
707 708 709

# Use `Range#cover?` instead of `Range#include?`.
Performance/RangeInclude:
710
  Enabled: true
711 712 713

# Use `sort` instead of `sort_by { |x| x }`.
Performance/RedundantSortBy:
714
  Enabled: true
715 716 717 718

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

721 722 723 724
# 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 已提交
725
  Enabled: true
726 727 728

# Checks for `.times.map` calls.
Performance/TimesMap:
729
  Enabled: true
730

731
# Rails #######################################################################
732

733 734 735 736 737
# Enables Rails cops.
Rails:
  Enabled: true

# Enforces consistent use of action filter methods.
738
Rails/ActionFilter:
739
  Enabled: true
740
  EnforcedStyle: action
741

742 743
# Checks the correct usage of date aware methods, such as `Date.today`,
# `Date.current`, etc.
G
Gabriel Mazetto 已提交
744 745 746
Rails/Date:
  Enabled: false

747 748
# Prefer delegate method for delegations.
Rails/Delegate:
749 750
  Enabled: false

751 752
# Prefer `find_by` over `where.first`.
Rails/FindBy:
753
  Enabled: true
754 755 756

# Prefer `all.find_each` over `all.find`.
Rails/FindEach:
757
  Enabled: true
758

759
# Prefer has_many :through to has_and_belongs_to_many.
760
Rails/HasAndBelongsToMany:
761
  Enabled: true
762

763
# Checks for calls to puts, print, etc.
764
Rails/Output:
765
  Enabled: true
766

767 768
# Checks for incorrect grammar when using methods like `3.day.ago`.
Rails/PluralizationGrammar:
769
  Enabled: true
770 771

# Checks for `read_attribute(:attr)` and `write_attribute(:attr, val)`.
772 773 774
Rails/ReadWriteAttribute:
  Enabled: false

775
# Checks the arguments of ActiveRecord scopes.
776
Rails/ScopeArgs:
777
  Enabled: true
778

779
# RSpec #######################################################################
R
Robert Speicher 已提交
780

781
# Check that instances are not being stubbed globally.
R
Robert Speicher 已提交
782 783 784
RSpec/AnyInstance:
  Enabled: false

785 786 787 788
# Check for expectations where `be(...)` can replace `eql(...)`.
RSpec/BeEql:
  Enabled: false

789 790
# Check that the first argument to the top level describe is the tested class or
# module.
R
Robert Speicher 已提交
791 792 793
RSpec/DescribeClass:
  Enabled: false

794
# Use `described_class` for tested class / module.
R
Robert Speicher 已提交
795 796 797
RSpec/DescribeMethod:
  Enabled: false

798 799 800
# Checks that the second argument to top level describe is the tested method
# name.
RSpec/DescribedClass:
R
Robert Speicher 已提交
801 802
  Enabled: false

803
# Checks for long example.
R
Robert Speicher 已提交
804 805 806 807
RSpec/ExampleLength:
  Enabled: false
  Max: 5

808
# Do not use should when describing your tests.
R
Robert Speicher 已提交
809 810 811 812 813 814 815 816
RSpec/ExampleWording:
  Enabled: false
  CustomTransform:
    be: is
    have: has
    not: does not
  IgnoredWords: []

817 818 819 820
# Checks for `expect(...)` calls containing literal values.
RSpec/ExpectActual:
  Enabled: true

821
# Checks the file and folder naming of the spec file.
R
Robert Speicher 已提交
822 823 824 825 826 827
RSpec/FilePath:
  Enabled: false
  CustomTransform:
    RuboCop: rubocop
    RSpec: rspec

828
# Checks if there are focused specs.
R
Robert Speicher 已提交
829 830 831
RSpec/Focus:
  Enabled: true

832
# Checks for the usage of instance variables.
R
Robert Speicher 已提交
833 834 835
RSpec/InstanceVariable:
  Enabled: false

836
# Checks for multiple top-level describes.
R
Robert Speicher 已提交
837 838 839
RSpec/MultipleDescribes:
  Enabled: false

840
# Enforces the usage of the same method on all negative message expectations.
R
Robert Speicher 已提交
841 842
RSpec/NotToNot:
  EnforcedStyle: not_to
843
  Enabled: true
R
Robert Speicher 已提交
844

845
# Prefer using verifying doubles over normal doubles.
R
Robert Speicher 已提交
846 847
RSpec/VerifiedDoubles:
  Enabled: false
848 849 850 851 852 853

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

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