/
.rubocop.yml
107 lines (82 loc) · 2.59 KB
/
.rubocop.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
inherit_from: .rubocop_todo.yml
inherit_mode:
merge:
- Exclude
require:
- rubocop-packaging
- rubocop-performance
- rubocop-rspec
AllCops:
NewCops: enable
TargetRubyVersion: 3.0
# Put development dependencies in the gemspec so rubygems.org knows about them
Gemspec/DevelopmentDependencies:
EnforcedStyle: gemspec
# Make BeginEndAlignment behavior match EndAlignment
Layout/BeginEndAlignment:
EnforcedStyleAlignWith: begin
# Spaces in strings with line continuations go at the beginning of the line.
Layout/LineContinuationLeadingSpace:
EnforcedStyle: leading
# Be lenient with line length
Layout/LineLength:
Max: 92
# Multi-line method calls should be simply indented. Aligning them makes it
# even harder to keep a sane line length.
Layout/MultilineMethodCallIndentation:
EnforcedStyle: indented
# Multi-line assignment should be simply indented. Aligning them makes it even
# harder to keep a sane line length.
Layout/MultilineOperationIndentation:
EnforcedStyle: indented
# Force consistent spacing independent of block contents
Layout/SpaceBeforeBlockBraces:
EnforcedStyleForEmptyBraces: space
# Assume the programmer knows how bracketed block syntax works
Lint/AmbiguousBlockAssociation:
Enabled: false
# Assume the programmer knows precendence rules
Lint/AmbiguousOperatorPrecedence:
Enabled: false
# Allow if (foo = get_foo) style
Lint/AssignmentInCondition:
AllowSafeAssignment: true
# Spec describe blocks and gem specification blocks can be any size
Metrics/BlockLength:
Exclude:
- 'spec/**/*'
- '*.gemspec'
Performance/StartWith:
AutoCorrect: true
# Allow and/or for control flow only
Style/AndOr:
EnforcedStyle: conditionals
# Require at least two dependent lines before suggesting a guard clause
Style/GuardClause:
MinBodyLength: 2
# Sometimes an if statement just looks better than next with a guard clause
Style/Next:
Enabled: false
# Explicite numbers are often clearer, and more robust.
Style/NumericPredicate:
Enabled: false
# Use older RuboCop default
Style/PercentLiteralDelimiters:
PreferredDelimiters:
'%W': ()
'%w': ()
# Allow explicit return with multiple return values
Style/RedundantReturn:
AllowMultipleReturnValues: true
# Do not commit to use of interpolation
Style/StringLiterals:
EnforcedStyle: double_quotes
# Make quoting outside and inside interpolation consistent
Style/StringLiteralsInInterpolation:
EnforcedStyle: double_quotes
# Prefer symbols to look like symbols
Style/SymbolArray:
EnforcedStyle: brackets
# Accessors are only trivial if they match the ivar name
Style/TrivialAccessors:
ExactNameMatch: true