-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.rubocop.yml
190 lines (144 loc) · 4.18 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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
AllCops:
TargetRubyVersion: 2.5
DisplayCopNames: true
UseCache: true
CacheRootDirectory: ./tmp/cache
# This is unnecessary since there are already other ways of measuring method
# size/complexity.
AbcSize:
Enabled: false
AccessModifierIndentation:
Enabled: true
EnforcedStyle: indent
# This lint prohibits method names starting with `get_`, which is often good
# advice but wrong too often to be worthwhile.
AccessorMethodName:
Enabled: false
# Allow developers to pass regexes as arguments without enclosing parens, e.g.
# response.body.should match /some regex/
AmbiguousRegexpLiteral:
Enabled: false
# Allow the case equality ("threequals") operator, which is often useful,
# especially for working with RSpec.
CaseEquality:
Enabled: false
ClassLength:
Severity: warning
# Don't require use of `collect` over `map`
CollectionMethods:
Enabled: false
CommentAnnotation:
Enabled: false
CyclomaticComplexity:
Severity: warning
Debugger:
Severity: error # binding.pry blocks!
DoubleNegation:
Enabled: false
FirstParameterIndentation:
Enabled: false
# Don't enforce using if/unless modifiers when you have a single-line body.
IfUnlessModifier:
Enabled: false
# We want to allow multi-line lambdas using the `->` syntax which Rubocop
# doesn't allow. We're also not too worried about people using `lambda` for
# single-line lambdas either.
Lambda:
Enabled: false
LineLength:
Max: 100
IgnoredPatterns:
- '\A#' # Allow longer comments
# There are a number of places where it makes sense to chain do...end blocks
MethodCalledOnDoEndBlock:
Enabled: false
MethodLength:
Severity: warning
Max: 30
Metrics/ModuleLength:
Severity: warning
Metrics/BlockLength:
Severity: warning
Exclude:
- spec/**/*
# Because we sometimes use RSpec's implicit subject syntax, we need to be able
# to format blocks more flexibly than in the main codebase.
MultilineBlockLayout:
Exclude:
- spec/**/*
ParameterLists:
CountKeywordArgs: false
PerceivedComplexity:
Severity: warning
# Prefer curly braces except for %i/%w/%W, since those return arrays.
PercentLiteralDelimiters:
PreferredDelimiters:
'%': '{}'
'%i': '[]'
'%q': '{}'
'%Q': '{}'
'%r': '{}'
'%s': '()'
'%w': '[]'
'%W': '[]'
'%x': '{}'
# Forcing the name of a predicate to `doctor?` makes it difficult to tell if it
# is a "has-a" or a "is-a" predicate, so disable it.
PredicateName:
Enabled: false
ShadowingOuterLocalVariable:
Severity: error
# Forcing the naming of arguments to `reduce` to be `|a, e|` isn't very useful.
SingleLineBlockParams:
Enabled: false
Layout/SpaceBeforeFirstArg:
AllowForAlignment: true
# There's no reason to enforce only using ASCII in comments.
Style/AsciiComments:
Enabled: false
Style/ModuleFunction:
Enabled: false
Layout/MultilineMethodCallIndentation:
EnforcedStyle: indented
Layout/MultilineMethodCallBraceLayout:
Enabled: false
Style/NumericLiterals:
Exclude:
- spec/**/*
# Middlewares have to do this all the time
Style/RescueStandardError:
Enabled: false
# It doesn't seem like .zero? and .nonzero? are more readable than == 0
Style/NumericPredicate:
Enabled: false
Style/TrailingCommaInArrayLiteral:
EnforcedStyleForMultiline: comma
Style/TrailingCommaInHashLiteral:
EnforcedStyleForMultiline: comma
Style/TrailingCommaInArguments:
EnforcedStyleForMultiline: comma
UnreachableCode:
Severity: error
UnusedMethodArgument:
AllowUnusedKeywordArguments: true
# Wastes CPU time, especially if the right-hand expression is expensive
UselessAssignment:
Severity: error
WhileUntilModifier:
Enabled: false
# Two strings in an array is not indicative that the array is likely to have
# elements added to it in the future, so up the minimum number of elements we
# warn on to 3.
WordArray:
MinSize: 3
Layout/ClosingParenthesisIndentation:
Enabled: false
Style/SpecialGlobalVars:
Enabled: false
# Checks for frozen string comment, designed to help upgrade to Ruby 3.0 (where
# frozen string literals will be default); disabled because we prefer calling `.freeze`
# on our string literals rather than using a magic comment.
Style/FrozenStringLiteralComment:
Enabled: false
Layout/DotPosition:
EnforcedStyle: trailing