-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.rubocop.yml
More file actions
296 lines (226 loc) · 6.02 KB
/
.rubocop.yml
File metadata and controls
296 lines (226 loc) · 6.02 KB
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
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
# yaml-language-server: $schema=https://www.rubyschema.org/rubocop.json
---
# Explicitly disable pending cops for now. This is the default behaviour but
# this avoids a large warning every time we run it.
# Stop RuboCop nagging about rubocop-rake.
# Ensure that RuboCop validates according to the lowest version of Ruby that we support.
AllCops:
Exclude:
- "bin/*"
NewCops: enable
SuggestExtensions: false
TargetRubyVersion: 3.2
# Whether MFA is required or not should be left to the token configuration.
Gemspec/RequireMFA:
Enabled: false
# Don't require this extra line break, it can be excessive.
Layout/EmptyLineAfterGuardClause:
Enabled: false
# Don't leave complex assignment values hanging off to the right.
Layout/EndAlignment:
EnforcedStyleAlignWith: variable
Layout/FirstArrayElementLineBreak:
Enabled: true
Layout/FirstHashElementLineBreak:
Enabled: true
Layout/FirstMethodArgumentLineBreak:
Enabled: true
Layout/FirstMethodParameterLineBreak:
Enabled: true
# Set a reasonable line length; rely on other cops to correct long lines.
Layout/LineLength:
AllowedPatterns:
- "^\\s*#.*$"
- ^require(_relative)?
- "DockerEngineRuby::Internal::Type::BaseModel$"
- "^\\s*[A-Z0-9_]+ = :"
- "DockerEngineRuby::(Models|Resources|Test)::"
Max: 110
Layout/MultilineArrayLineBreaks:
Enabled: true
# Start the assignment on the same line variable is mentioned.
Layout/MultilineAssignmentLayout:
EnforcedStyle: same_line
Layout/MultilineHashKeyLineBreaks:
Enabled: true
Layout/MultilineMethodArgumentLineBreaks:
Enabled: true
Layout/MultilineMethodParameterLineBreaks:
Enabled: true
# Prefer compact hash literals.
Layout/SpaceInsideHashLiteralBraces:
EnforcedStyle: no_space
Exclude:
- "**/*.rbi"
Lint/BooleanSymbol:
Enabled: false
# This option occasionally mangles identifier names
Lint/DeprecatedConstants:
Exclude:
- "**/*.rbi"
# We use pattern assertion in tests to ensure correctness.
Lint/DuplicateMatchPattern:
Exclude:
- "test/**/*"
# Fairly useful in tests for pattern assertions.
Lint/EmptyInPattern:
Exclude:
- "test/**/*"
Lint/MissingCopEnableDirective:
Exclude:
- "examples/**/*.rb"
Lint/MissingSuper:
Exclude:
- "**/*.rbi"
Lint/SymbolConversion:
Exclude:
- "**/*.rbi"
# Disabled for safety reasons, this option changes code semantics.
Lint/UnusedMethodArgument:
AutoCorrect: false
# This option is prone to causing accidental bugs.
Lint/UselessAssignment:
AutoCorrect: false
Exclude:
- "examples/**/*.rb"
Metrics/AbcSize:
Enabled: false
Metrics/BlockLength:
AllowedPatterns:
- assert_pattern
- type_alias
- define_sorbet_constant!
Exclude:
- "**/*.rbi"
Metrics/ClassLength:
Enabled: false
Metrics/CollectionLiteralLength:
Exclude:
- "test/**/*"
Metrics/CyclomaticComplexity:
Enabled: false
Metrics/MethodLength:
Enabled: false
Metrics/ModuleLength:
Enabled: false
Metrics/ParameterLists:
Enabled: false
Metrics/PerceivedComplexity:
Enabled: false
Naming/AccessorMethodName:
Enabled: false
# Need to preserve block identifier for documentation.
Naming/BlockForwarding:
Enabled: false
# Underscores are generally useful for disambiguation.
Naming/ClassAndModuleCamelCase:
Enabled: false
Naming/MethodParameterName:
Enabled: false
Naming/PredicatePrefix:
Exclude:
- "**/*.rbi"
Naming/VariableNumber:
Enabled: false
# Nothing wrong with inline private methods.
Style/AccessModifierDeclarations:
Enabled: false
Style/AccessorGrouping:
Exclude:
- "**/*.rbi"
# Behaviour of alias_method is more predictable.
Style/Alias:
EnforcedStyle: prefer_alias_method
# And/or have confusing precedence, avoid them.
Style/AndOr:
EnforcedStyle: always
Style/ArgumentsForwarding:
Enabled: false
Style/BisectedAttrAccessor:
Exclude:
- "**/*.rbi"
# We prefer nested modules in lib/, but are currently using compact style for tests.
Style/ClassAndModuleChildren:
Exclude:
- "test/**/*"
Style/CommentAnnotation:
Enabled: false
# We should go back and add these docs, but ignore for now.
Style/Documentation:
Enabled: false
# Allow explicit empty elses, for clarity.
Style/EmptyElse:
Enabled: false
Style/EmptyMethod:
Exclude:
- "**/*.rbi"
# We commonly use ENV['KEY'], it's OK.
Style/FetchEnvVar:
Enabled: false
# Just to be safe, ensure nobody is mutating our internal strings.
Style/FrozenStringLiteralComment:
EnforcedStyle: always
Exclude:
- "**/*.rbi"
# Nothing wrong with clear if statements.
Style/IfUnlessModifier:
Enabled: false
# Rubocop is pretty bad about mangling single line lambdas.
Style/Lambda:
Enabled: false
# Prefer consistency in method calling syntax.
Style/MethodCallWithArgsParentheses:
AllowedMethods:
- raise
Enabled: true
Exclude:
- "**/*.gemspec"
Style/MultilineBlockChain:
Enabled: false
# Perfectly fine.
Style/MultipleComparison:
Enabled: false
Style/MutableConstant:
Exclude:
- "**/*.rbi"
# Not all parameters should be named.
Style/NumberedParameters:
Enabled: false
Style/NumberedParametersLimit:
Max: 2
# Reasonable to use brackets for errors with long messages.
Style/RaiseArgs:
Enabled: false
# Be explicit about `RuntimeError`s.
Style/RedundantException:
Enabled: false
Style/RedundantInitialize:
Exclude:
- "**/*.rbi"
Style/RedundantParentheses:
Exclude:
- "**/*.rbi"
# Prefer slashes for regex literals.
Style/RegexpLiteral:
EnforcedStyle: slashes
# Allow explicit ifs, especially for imperative use.
Style/SafeNavigation:
Enabled: false
Style/SignalException:
Exclude:
- Rakefile
- "**/*.rake"
# We use these sparingly, where we anticipate future branches for the
# inner conditional.
Style/SoleNestedConditional:
Enabled: false
# Prefer double quotes so that interpolation can be easily added.
Style/StringLiterals:
EnforcedStyle: double_quotes
# Prefer explicit symbols for clarity; you can search for `:the_symbol`.
Style/SymbolArray:
EnforcedStyle: brackets
# This option makes examples harder to read for ruby novices.
Style/SymbolProc:
Exclude:
- "examples/**/*.rb"