.rubocop.yml 26.4 KB
Newer Older
1 2 3
require:
  - rubocop-rspec
  - ./rubocop/rubocop
Robert Speicher's avatar
Robert Speicher committed
4

Z.J. van de Weg's avatar
Z.J. van de Weg committed
5 6
inherit_from: .rubocop_todo.yml

7
AllCops:
Z.J. van de Weg's avatar
Z.J. van de Weg committed
8
  TargetRubyVersion: 2.3
Z.J. van de Weg's avatar
Z.J. van de Weg committed
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/**/*'
20
    - 'node_modules/**/*'
21 22
    - 'db/*'
    - 'db/fixtures/**/*'
23 24
    - 'tmp/**/*'
    - 'bin/**/*'
25
    - 'generator_templates/**/*'
26
    - 'builds/**/*'
27

Douwe Maan's avatar
Douwe Maan committed
28
# Gems in consecutive lines should be alphabetically sorted
Douwe Maan's avatar
Douwe Maan committed
29 30 31
Bundler/OrderedGems:
  Enabled: false

32
# Style #######################################################################
33 34

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

38 39 40 41
# Check the naming of accessor methods for get_/set_.
Style/AccessorMethodName:
  Enabled: false

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

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

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

Douwe Maan's avatar
Douwe Maan committed
55 56
# Here we check if the parameters on a multi-line method call or
# definition are aligned.
Douwe Maan's avatar
Douwe Maan committed
57 58 59
Style/AlignParameters:
  Enabled: false

Douwe Maan's avatar
Douwe Maan committed
60 61 62 63 64
# Whether `and` and `or` are banned only in conditionals (conditionals)
# or completely (always).
Style/AndOr:
  Enabled: true

65
# Use `Array#join` instead of `Array#*`.
66
Style/ArrayJoin:
67
  Enabled: true
68

69
# Use only ascii symbols in comments.
70
Style/AsciiComments:
71
  Enabled: true
72

73
# Use only ascii symbols in identifiers.
74
Style/AsciiIdentifiers:
75
  Enabled: true
76

77
# Checks for uses of Module#attr.
78
Style/Attr:
79
  Enabled: true
80

81
# Avoid the use of BEGIN blocks.
82
Style/BeginBlock:
83
  Enabled: true
84

85
# Do not use block comments.
86
Style/BlockComments:
87
  Enabled: true
88

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

Douwe Maan's avatar
Douwe Maan committed
94 95 96 97
# Put end statement of multiline block on its own line.
Style/BlockEndNewline:
  Enabled: true

Douwe Maan's avatar
Douwe Maan committed
98 99
 # This cop checks for braces around the last parameter in a method call
# if the last parameter is a hash.
Douwe Maan's avatar
Douwe Maan committed
100 101 102
Style/BracesAroundHashParameters:
  Enabled: false

Douwe Maan's avatar
Douwe Maan committed
103
# This cop checks for uses of the case equality operator(===).
Douwe Maan's avatar
Douwe Maan committed
104 105 106
Style/CaseEquality:
  Enabled: false

107
# Indentation of when in a case/when/[else/]end.
108
Style/CaseIndentation:
109
  Enabled: true
110

111
# Checks for uses of character literals.
112
Style/CharacterLiteral:
113
  Enabled: true
114

115
# Use CamelCase for classes and modules.'
116
Style/ClassAndModuleCamelCase:
117
  Enabled: true
118

119
# Checks style of children classes and modules.
120 121 122
Style/ClassAndModuleChildren:
  Enabled: false

123
# Enforces consistent use of `Object#is_a?` or `Object#kind_of?`.
124
Style/ClassCheck:
Douwe Maan's avatar
Douwe Maan committed
125
  Enabled: true
126

127
# Use self when defining module/class methods.
128
Style/ClassMethods:
129
  Enabled: true
130

131
# Avoid the use of class variables.
132
Style/ClassVars:
133
  Enabled: true
134

Douwe Maan's avatar
Douwe Maan committed
135 136
# This cop checks for methods invoked via the :: operator instead
# of the . operator (like FileUtils::rmdir instead of FileUtils.rmdir).
Douwe Maan's avatar
Douwe Maan committed
137 138 139
Style/ColonMethodCall:
  Enabled: true

Douwe Maan's avatar
Douwe Maan committed
140 141
# This cop checks that comment annotation keywords are written according
# to guidelines.
Douwe Maan's avatar
Douwe Maan committed
142 143 144
Style/CommentAnnotation:
  Enabled: false

145
# Indentation of comments.
146
Style/CommentIndentation:
147
  Enabled: true
148

Douwe Maan's avatar
Douwe Maan committed
149 150 151
# Check for `if` and `case` statements where each branch is used for
# assignment to the same variable when using the return of the
# condition can be used instead.
Douwe Maan's avatar
Douwe Maan committed
152 153 154
Style/ConditionalAssignment:
  Enabled: true

155
# Constants should use SCREAMING_SNAKE_CASE.
156
Style/ConstantName:
157
  Enabled: true
158

159
# Use def with parentheses when there are arguments.
160
Style/DefWithParentheses:
161
  Enabled: true
162

163
# Document classes and non-namespace modules.
164 165 166
Style/Documentation:
  Enabled: false

167 168 169 170 171
# Multi-line method chaining should be done with leading dots.
Style/DotPosition:
  Enabled: true
  EnforcedStyle: leading

Douwe Maan's avatar
Douwe Maan committed
172 173 174
# This cop checks for uses of double negation (!!) to convert something
# to a boolean value. As this is both cryptic and usually redundant, it
# should be avoided.
Douwe Maan's avatar
Douwe Maan committed
175 176 177
Style/DoubleNegation:
  Enabled: false

178
# Align elses and elsifs correctly.
179
Style/ElseAlignment:
180
  Enabled: true
181

182
# Use empty lines between defs.
183
Style/EmptyLineBetweenDefs:
184
  Enabled: true
185

186
# Don't use several empty lines in a row.
187
Style/EmptyLines:
188
  Enabled: true
189

190
# Keep blank lines around access modifiers.
191
Style/EmptyLinesAroundAccessModifier:
192
  Enabled: true
193

194
# Keeps track of empty lines around block bodies.
195
Style/EmptyLinesAroundBlockBody:
196
  Enabled: true
197

198
# Keeps track of empty lines around class bodies.
199
Style/EmptyLinesAroundClassBody:
200
  Enabled: true
201

202
# Keeps track of empty lines around method bodies.
203
Style/EmptyLinesAroundMethodBody:
204
  Enabled: true
205

Douwe Maan's avatar
Douwe Maan committed
206 207 208 209
# Keeps track of empty lines around module bodies.
Style/EmptyLinesAroundModuleBody:
  Enabled: true

210
# Avoid the use of END blocks.
211
Style/EndBlock:
212
  Enabled: true
213

214
# Use Unix-style line endings.
215
Style/EndOfLine:
216
  Enabled: true
217

218
# Favor the use of Fixnum#even? && Fixnum#odd?
219
Style/EvenOdd:
220
  Enabled: true
221

222
# Use snake_case for source file names.
223
Style/FileName:
224 225 226
  Enabled: true

# Checks for a line break before the first parameter in a multi-line method
227
# parameter definition.
228 229
Style/FirstMethodParameterLineBreak:
  Enabled: true
230

231
# Checks for flip flops.
232
Style/FlipFlop:
233
  Enabled: true
234

235
# Checks use of for or each in multiline loops.
236
Style/For:
237
  Enabled: true
238

Z.J. van de Weg's avatar
Z.J. van de Weg committed
239 240 241
# Checks if there is a magic comment to enforce string literals
Style/FrozenStringLiteralComment:
  Enabled: false
242

243
# Do not introduce global variables.
244
Style/GlobalVars:
245
  Enabled: true
246 247 248
  Exclude:
    - 'lib/backup/**/*'
    - 'lib/tasks/**/*'
249

250 251
# Prefer Ruby 1.9 hash syntax `{ a: 1, b: 2 }`
# over 1.8 syntax `{ :a => 1, :b => 2 }`.
252
Style/HashSyntax:
253
  Enabled: true
254

255 256 257
# 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:
258
  Enabled: true
259

Douwe Maan's avatar
Douwe Maan committed
260 261 262 263
# Do not use if x; .... Use the ternary operator instead.
Style/IfWithSemicolon:
  Enabled: true

264
# Checks the indentation of the first line of the right-hand-side of a
265
# multi-line assignment.
266
Style/IndentAssignment:
267
  Enabled: true
268 269

# Keep indentation straight.
270
Style/IndentationConsistency:
271
  Enabled: true
272

273
# Use 2 spaces for indentation.
274
Style/IndentationWidth:
275
  Enabled: true
276

277
# Use Kernel#loop for infinite loops.
278
Style/InfiniteLoop:
279
  Enabled: true
280

281
# Use lambda.call(...) instead of lambda.(...).
282
Style/LambdaCall:
283
  Enabled: true
284

285
# Comments should start with a space.
286
Style/LeadingCommentSpace:
Felipe Artur's avatar
Felipe Artur committed
287
  Enabled: true
288

289
# Checks if the method definitions have or don't have parentheses.
290
Style/MethodDefParentheses:
291
  Enabled: true
292

293
# Use the configured style when naming methods.
294
Style/MethodName:
295
  Enabled: true
296

297 298 299 300
# Checks for usage of `extend self` in modules.
Style/ModuleFunction:
  Enabled: false

Robert Speicher's avatar
Robert Speicher committed
301 302 303
# 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:
304
  Enabled: true
Robert Speicher's avatar
Robert Speicher committed
305 306
  EnforcedStyle: symmetrical

307
# Avoid multi-line chains of blocks.
308
Style/MultilineBlockChain:
309
  Enabled: true
310

311
# Ensures newlines after multiline block do statements.
312
Style/MultilineBlockLayout:
313
  Enabled: true
314

Robert Speicher's avatar
Robert Speicher committed
315 316 317
# 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:
318
  Enabled: true
Robert Speicher's avatar
Robert Speicher committed
319 320
  EnforcedStyle: symmetrical

321
# Do not use then for multi-line if/unless.
322
Style/MultilineIfThen:
323
  Enabled: true
324

Robert Speicher's avatar
Robert Speicher committed
325 326 327 328 329 330
# 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

331 332 333 334 335
# Checks indentation of method calls with the dot operator that span more than
# one line.
Style/MultilineMethodCallIndentation:
  Enabled: false

336 337 338 339 340
# 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

341
# Checks indentation of binary operations that span more than one line.
342
Style/MultilineOperationIndentation:
343 344
  Enabled: true
  EnforcedStyle: indented
345

346 347 348 349
# Avoid multi-line `? :` (the ternary operator), use if/unless instead.
Style/MultilineTernaryOperator:
  Enabled: true

Douwe Maan's avatar
Douwe Maan committed
350 351
# This cop checks whether some constant value isn't a
# mutable literal (e.g. array or hash).
Douwe Maan's avatar
Douwe Maan committed
352 353
Style/MutableConstant:
  Enabled: true
354 355 356
  Exclude:
    - 'db/migrate/**/*'
    - 'db/post_migrate/**/*'
Douwe Maan's avatar
Douwe Maan committed
357

358
# Favor unless over if for negative conditions (or control flow or).
359
Style/NegatedIf:
360
  Enabled: true
361

362 363
# Avoid using nested modifiers.
Style/NestedModifier:
364
  Enabled: true
365 366

# Use one expression per branch in a ternary operator.
367
Style/NestedTernaryOperator:
368
  Enabled: true
369

370
# Prefer x.nil? to x == nil.
371
Style/NilComparison:
372
  Enabled: true
373

374
# Checks for redundant nil checks.
375
Style/NonNilCheck:
376
  Enabled: true
377

378
# Use ! instead of not.
379
Style/Not:
380
  Enabled: true
381

382
# Add underscores to large numeric literals to improve their readability.
383 384 385
Style/NumericLiterals:
  Enabled: false

386
# Favor the ternary operator(?:) over if/then/else/end constructs.
387
Style/OneLineConditional:
388
  Enabled: true
389

390
# When defining binary operators, name the argument other.
391
Style/OpMethod:
392
  Enabled: true
393

394
# Don't use parentheses around the condition of an if/unless/while.
395
Style/ParenthesesAroundCondition:
396
  Enabled: true
397

398 399 400 401 402 403 404
# This cop (by default) checks for uses of methods Hash#has_key? and
# Hash#has_value? where it enforces Hash#key? and Hash#value?
# It is configurable to enforce the inverse, using `verbose` method
# names also.
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: short, verbose
Style/PreferredHashMethods:
405
  Enabled: false
406

407 408 409 410
# Checks for an obsolete RuntimeException argument in raise/fail.
Style/RedundantException:
  Enabled: true

411 412
# Checks for parentheses that seem not to serve any purpose.
Style/RedundantParentheses:
413
  Enabled: true
414 415

# Don't use semicolons to terminate expressions.
416
Style/Semicolon:
417
  Enabled: true
418

419
# Checks for proper usage of fail and raise.
420
Style/SignalException:
421 422
  EnforcedStyle: only_raise
  Enabled: true
423

424
# Use spaces after colons.
425
Style/SpaceAfterColon:
426
  Enabled: true
427

428
# Use spaces after commas.
429
Style/SpaceAfterComma:
430
  Enabled: true
431

432 433
# Do not put a space between a method name and the opening parenthesis in a
# method definition.
434
Style/SpaceAfterMethodName:
435
  Enabled: true
436

437
# Tracks redundant space after the ! operator.
438
Style/SpaceAfterNot:
439
  Enabled: true
440

441
# Use spaces after semicolons.
442
Style/SpaceAfterSemicolon:
443
  Enabled: true
444

445 446 447 448
# Use space around equals in parameter default
Style/SpaceAroundEqualsInParameterDefault:
  Enabled: true

449 450
# Use a space around keywords if appropriate.
Style/SpaceAroundKeyword:
451
  Enabled: true
452

453 454
# Use a single space around operators.
Style/SpaceAroundOperators:
455
  Enabled: true
456

457 458
# No spaces before commas.
Style/SpaceBeforeComma:
459
  Enabled: true
460

461 462
# Checks for missing space between code and a comment on the same line.
Style/SpaceBeforeComment:
463
  Enabled: true
464

465 466
# No spaces before semicolons.
Style/SpaceBeforeSemicolon:
467
  Enabled: true
468

Douwe Maan's avatar
Douwe Maan committed
469
# Checks for spaces inside square brackets.
470 471 472
Style/SpaceInsideBrackets:
  Enabled: true

473
# Use spaces inside hash literal braces - or don't.
474
Style/SpaceInsideHashLiteralBraces:
475
  Enabled: true
476

477
# No spaces inside range literals.
478
Style/SpaceInsideRangeLiteral:
479
  Enabled: true
480

481 482
# Checks for padding/surrounding spaces inside string interpolation.
Style/SpaceInsideStringInterpolation:
483 484
  EnforcedStyle: no_space
  Enabled: true
485 486 487

# Check for the usage of parentheses around stabby lambda arguments.
Style/StabbyLambdaParentheses:
488 489
  EnforcedStyle: require_parentheses
  Enabled: true
490 491

# Checks if uses of quotes match the configured preference.
492 493 494
Style/StringLiterals:
  Enabled: false

495 496
# Checks if configured preferred methods are used over non-preferred.
Style/StringMethods:
497 498 499
  PreferredMethods:
    intern: to_sym
  Enabled: true
500 501

# No hard tabs.
502
Style/Tab:
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
503
  Enabled: true
504

505
# Checks trailing blank lines and final newline.
506
Style/TrailingBlankLines:
507
  Enabled: true
508

Douwe Maan's avatar
Douwe Maan committed
509
# This cop checks for trailing comma in array and hash literals.
510
Style/TrailingCommaInLiteral:
511 512
  Enabled: true
  EnforcedStyleForMultiline: no_comma
513

514 515 516 517 518
# This cop checks for trailing comma in argument lists.
Style/TrailingCommaInArguments:
  Enabled: true
  EnforcedStyleForMultiline: no_comma

519
# Checks for %W when interpolation is not needed.
520
Style/UnneededCapitalW:
521
  Enabled: true
522

523
# Checks for %q/%Q when single quotes or double quotes would do.
524 525 526
Style/UnneededPercentQ:
  Enabled: false

527
# Don't interpolate global, instance and class variables directly in strings.
528
Style/VariableInterpolation:
529
  Enabled: true
530

531
# Use the configured style when naming variables.
532
Style/VariableName:
533 534
  EnforcedStyle: snake_case
  Enabled: true
535

536 537 538 539
# Use the configured style when numbering variables.
Style/VariableNumber:
  Enabled: false

540
# Use when x then ... for one-line cases.
541
Style/WhenThen:
542
  Enabled: true
543

544
# Checks for redundant do after while or until.
545
Style/WhileUntilDo:
546
  Enabled: true
547

548
# Favor modifier while/until usage when you have a single-line body.
549
Style/WhileUntilModifier:
550
  Enabled: true
551

552
# Use %w or %W for arrays of words.
553
Style/WordArray:
Douwe Maan's avatar
Douwe Maan committed
554
  Enabled: true
555

mhasbini's avatar
mhasbini committed
556 557 558 559
# Use `proc` instead of `Proc.new`.
Style/Proc:
  Enabled: true

560
# Metrics #####################################################################
561

562 563
# A calculated magnitude based on number of assignments,
# branches, and conditions.
564
Metrics/AbcSize:
Grzegorz Bizon's avatar
Grzegorz Bizon committed
565
  Enabled: true
566
  Max: 56.96
Grzegorz Bizon's avatar
Grzegorz Bizon committed
567

Douwe Maan's avatar
Douwe Maan committed
568
# This cop checks if the length of a block exceeds some maximum value.
Douwe Maan's avatar
Douwe Maan committed
569 570 571
Metrics/BlockLength:
  Enabled: false

572
# Avoid excessive block nesting.
573
Metrics/BlockNesting:
Grzegorz Bizon's avatar
Grzegorz Bizon committed
574 575
  Enabled: true
  Max: 4
576

577
# Avoid classes longer than 100 lines of code.
578 579 580
Metrics/ClassLength:
  Enabled: false

581 582 583 584
# A complexity metric that is strongly correlated to the number
# of test cases needed to validate a method.
Metrics/CyclomaticComplexity:
  Enabled: true
585
  Max: 16
586 587

# Limit lines to 80 characters.
588 589 590
Metrics/LineLength:
  Enabled: false

591
# Avoid methods longer than 10 lines of code.
592 593 594
Metrics/MethodLength:
  Enabled: false

595
# Avoid modules longer than 100 lines of code.
596 597 598
Metrics/ModuleLength:
  Enabled: false

599 600 601 602 603 604 605 606
# 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
607
  Max: 18
608

609
# Lint ########################################################################
610

611 612
# Checks for ambiguous operators in the first argument of a method invocation
# without parentheses.
613
Lint/AmbiguousOperator:
614
  Enabled: true
615

Douwe Maan's avatar
Douwe Maan committed
616 617
# This cop checks for ambiguous regexp literals in the first argument of
# a method invocation without parentheses.
Douwe Maan's avatar
Douwe Maan committed
618 619 620
Lint/AmbiguousRegexpLiteral:
  Enabled: false

Douwe Maan's avatar
Douwe Maan committed
621 622
# This cop checks for assignments in the conditions of
# if/while/until.
Douwe Maan's avatar
Douwe Maan committed
623 624 625
Lint/AssignmentInCondition:
  Enabled: false

626
# Align block ends correctly.
627
Lint/BlockAlignment:
628
  Enabled: true
629

630 631 632
# Default values in optional keyword arguments and optional ordinal arguments
# should not refer back to the name of the argument.
Lint/CircularArgumentReference:
633
  Enabled: true
634 635

# Checks for condition placed in a confusing position relative to the keyword.
636
Lint/ConditionPosition:
637
  Enabled: true
638

639
# Check for debugger calls.
640
Lint/Debugger:
641
  Enabled: true
642

643
# Align ends corresponding to defs correctly.
644
Lint/DefEndAlignment:
645
  Enabled: true
646

647
# Check for deprecated class method calls.
648
Lint/DeprecatedClassMethods:
649
  Enabled: true
650

651 652
# Check for immutable argument given to each_with_object.
Lint/EachWithObjectArgument:
653
  Enabled: true
654 655

# Check for odd code arrangement in an else block.
656
Lint/ElseLayout:
657
  Enabled: true
658

659
# Checks for empty ensure block.
660
Lint/EmptyEnsure:
661
  Enabled: true
662

663 664 665 666
# Checks for the presence of `when` branches without a body.
Lint/EmptyWhen:
  Enabled: true

667
# Align ends correctly.
668
Lint/EndAlignment:
669
  Enabled: true
670

671
# END blocks should not be placed inside method definitions.
672
Lint/EndInMethod:
673
  Enabled: true
674

675
# Do not use return in an ensure block.
676
Lint/EnsureReturn:
677
  Enabled: true
678

679 680
# Catches floating-point literals too large or small for Ruby to represent.
Lint/FloatOutOfRange:
681
  Enabled: true
682 683 684

# The number of parameters to format/sprint must match the fields.
Lint/FormatParameterMismatch:
685
  Enabled: true
686

Douwe Maan's avatar
Douwe Maan committed
687
# This cop checks for *rescue* blocks with no body.
Douwe Maan's avatar
Douwe Maan committed
688 689 690
Lint/HandleExceptions:
  Enabled: false

691 692 693
# Checks for adjacent string literals on the same line, which could better be
# represented as a single string literal.
Lint/ImplicitStringConcatenation:
694
  Enabled: true
695

Douwe Maan's avatar
Douwe Maan committed
696 697 698 699 700
# Checks for attempts to use `private` or `protected` to set the visibility
# of a class method, which does not work.
Lint/IneffectiveAccessModifier:
  Enabled: false

701 702
# Checks for invalid character literals with a non-escaped whitespace
# character.
703
Lint/InvalidCharacterLiteral:
704
  Enabled: true
705

706
# Checks of literals used in conditions.
707
Lint/LiteralInCondition:
708
  Enabled: true
709

710
# Checks for literals used in interpolation.
711
Lint/LiteralInInterpolation:
712
  Enabled: true
713

Douwe Maan's avatar
Douwe Maan committed
714
# This cop checks for uses of *begin...end while/until something*.
Douwe Maan's avatar
Douwe Maan committed
715 716 717
Lint/Loop:
  Enabled: false

718 719
# Do not use nested method definitions.
Lint/NestedMethodDefinition:
720
  Enabled: true
721 722 723

# Do not omit the accumulator when calling `next` in a `reduce`/`inject` block.
Lint/NextWithoutAccumulator:
724
  Enabled: true
725 726

# Checks for method calls with a space before the opening parenthesis.
727
Lint/ParenthesesAsGroupedExpression:
728
  Enabled: true
729

730 731 732
# Checks for `rand(1)` calls. Such calls always return `0` and most likely
# a mistake.
Lint/RandOne:
733
  Enabled: true
734 735

# Use parentheses in the method call to avoid confusion about precedence.
736
Lint/RequireParentheses:
737
  Enabled: true
738

739
# Avoid rescuing the Exception class.
740
Lint/RescueException:
741
  Enabled: true
742

Connor Shea's avatar
Connor Shea committed
743 744
# Checks for the order which exceptions are rescued to avoid rescueing a less specific exception before a more specific exception.
Lint/ShadowedException:
745 746
  Enabled: false

Douwe Maan's avatar
Douwe Maan committed
747 748
# This cop looks for use of the same name as outer local variables
# for block arguments or block local variables.
Douwe Maan's avatar
Douwe Maan committed
749 750 751
Lint/ShadowingOuterLocalVariable:
  Enabled: false

752 753 754 755
# Checks for Object#to_s usage in string interpolation.
Lint/StringConversionInInterpolation:
  Enabled: true

756
# Do not use prefix `_` for a variable that is used.
757
Lint/UnderscorePrefixedVariableName:
758
  Enabled: true
759

Douwe Maan's avatar
Douwe Maan committed
760
# This cop checks for using Fixnum or Bignum constant
Douwe Maan's avatar
Douwe Maan committed
761 762 763
Lint/UnifiedInteger:
  Enabled: true

764 765 766 767 768 769
# 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

Douwe Maan's avatar
Douwe Maan committed
770
# This cop checks for unneeded usages of splat expansion
Douwe Maan's avatar
Douwe Maan committed
771 772 773
Lint/UnneededSplatExpansion:
  Enabled: false

774
# Unreachable code.
775
Lint/UnreachableCode:
776
  Enabled: true
777

Douwe Maan's avatar
Douwe Maan committed
778
# This cop checks for unused block arguments.
Douwe Maan's avatar
Douwe Maan committed
779 780 781
Lint/UnusedBlockArgument:
  Enabled: false

Douwe Maan's avatar
Douwe Maan committed
782
# This cop checks for unused method arguments.
783 784 785
Lint/UnusedMethodArgument:
  Enabled: false

Douwe Maan's avatar
Douwe Maan committed
786 787 788 789
# Checks for useless access modifiers.
Lint/UselessAccessModifier:
  Enabled: true

790
# Checks for useless assignment to a local variable.
791
Lint/UselessAssignment:
792
  Enabled: true