-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdefault.yml
408 lines (397 loc) · 9.33 KB
/
default.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
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
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
require:
- rubocop-factory_bot
- rubocop-rails
- rubocop-rspec
- rubocop-rspec_rails
- ./custom_cops/nxt_core/rails/use_of_rails_logger.rb
inherit_mode:
merge:
- Exclude
- Include
Rails/UseOfRailsLogger:
Description: "Custom Getsafe cop to ensure the correct logger is used"
AllCops:
Exclude:
- bin/guard
- bin/rspec
- bin/rubocop
- bin/setup
- config.ru
- db/schema.rb
- db/migrate/*
- vendor/**/*
- node_modules/**/*
DisabledByDefault: false
NewCops: disable # to avoid warnings. TODO: remove this setting and add new cops from the warning.
Layout/ArgumentAlignment:
EnforcedStyle: with_fixed_indentation
Layout/ArrayAlignment:
EnforcedStyle: with_fixed_indentation
Layout/ParameterAlignment:
EnforcedStyle: with_fixed_indentation
Layout/MultilineArrayLineBreaks:
Enabled: true
Layout/MultilineHashKeyLineBreaks:
Enabled: true
Layout/FirstMethodArgumentLineBreak:
Enabled: true
Layout/MultilineMethodCallBraceLayout:
EnforcedStyle: new_line
Layout/MultilineMethodCallIndentation:
EnforcedStyle: indented
Layout/MultilineMethodDefinitionBraceLayout:
EnforcedStyle: new_line
Layout/SpaceAroundOperators:
AllowForAlignment: false
Layout/SpaceBeforeBrackets:
Enabled: true
Layout/FirstMethodParameterLineBreak:
Enabled: true
Layout/EndAlignment:
EnforcedStyleAlignWith: start_of_line
Layout/BlockAlignment:
EnforcedStyleAlignWith: start_of_block
Layout/FirstHashElementLineBreak:
Enabled: true
Layout/FirstArrayElementIndentation:
EnforcedStyle: consistent
Layout/FirstArrayElementLineBreak:
Enabled: true
Layout/MultilineMethodParameterLineBreaks:
Enabled: true
# Lint
Lint:
Enabled: true
Lint/AmbiguousBlockAssociation:
Exclude:
- spec/**/*
Lint/AssignmentInCondition:
Enabled: true
Lint/DuplicateHashKey:
Enabled: true
Lint/DuplicateRegexpCharacterClassElement:
Enabled: true
Lint/EmptyInPattern:
Enabled: true
Lint/IncompatibleIoSelectWithFiberScheduler:
Enabled: true
Lint/LambdaWithoutLiteralBlock:
Enabled: true
Lint/Loop:
Enabled: true
Lint/MissingSuper:
Enabled: true
Lint/NoReturnInBeginEndBlocks:
Enabled: true
Lint/NumberedParameterAssignment:
Enabled: true
Lint/RefinementImportMethods:
Enabled: true
Lint/RequireRelativeSelfPath:
Enabled: true
Lint/ToEnumArguments:
Enabled: true
Lint/UnexpectedBlockArity:
Enabled: true
Lint/UselessRuby2Keywords:
Enabled: true
Lint/SymbolConversion:
EnforcedStyle: consistent
Lint/AmbiguousAssignment:
Enabled: true
Lint/DeprecatedConstants:
Enabled: true
Lint/AmbiguousRange:
Enabled: true
Lint/AmbiguousOperatorPrecedence:
Enabled: true
Lint/TripleQuotes:
Enabled: true
Lint/ConstantOverwrittenInRescue:
Enabled: true
Lint/NonAtomicFileOperation:
Enabled: true
Lint/UnmodifiedReduceAccumulator:
Enabled: true
Lint/OrAssignmentToConstant:
Enabled: true
Lint/RedundantDirGlobSort:
Enabled: true
Lint/RequireRangeParentheses:
Enabled: true
# Lint - These checks are valid, but better left to programmer's discretion, as the effects of such code are harmless.
Lint/DuplicateBranch:
Enabled: false
Lint/EmptyBlock:
Enabled: false
Lint/EmptyClass:
Enabled: false
# Lint - Since we don't have all cops enabled by default we have to add every new cop explicitly
Lint/DuplicateMagicComment:
Enabled: true
Lint/UselessRescue:
Enabled: false
Lint/DuplicateMatchPattern:
Enabled: true
Lint/MixedCaseRange:
Enabled: true
Lint/RedundantRegexpQuantifiers:
Enabled: true
Style/TrailingCommaInHashLiteral:
Enabled: false
Style/HashSyntax:
Enabled: true
EnforcedShorthandSyntax: either
Security:
EnabledByDefault: true
Style/Semicolon:
Exclude:
- spec/**/*
Rails/TimeZone:
Enabled: true
Rails/Date:
Enabled: true
RSpec:
Enabled: false
RSpec/Focus:
Enabled: true
# This is default cops we want to keep disabled:
Style/FrozenStringLiteralComment:
Enabled: false
Layout/LineLength:
Enabled: false
Style/ArgumentsForwarding:
Enabled: false
Naming/BlockForwarding:
Enabled: false
Rails/FreezeTime:
Enabled: false
Style/Documentation:
Enabled: false
Metrics/MethodLength:
Enabled: false
Naming/VariableNumber:
Enabled: false
Metrics/AbcSize:
Enabled: false
Metrics/ClassLength:
Enabled: false
Style/ClassAndModuleChildren:
Enabled: false
Metrics/BlockLength:
Enabled: false
Metrics/CyclomaticComplexity:
Enabled: false
Style/SafeNavigation:
Enabled: false
Rails/Output:
Enabled: false
Style/Next: # this one looks dangerous
Enabled: false
Bundler/OrderedGems:
Enabled: false
Bundler/DuplicatedGroup:
Enabled: false
Rails/HttpStatus:
Enabled: false
Rails/SkipsModelValidations:
Enabled: false
Style/InfiniteLoop:
Enabled: false
Style/StderrPuts:
Enabled: false
Style/NumericPredicate:
Enabled: false
Metrics/PerceivedComplexity:
Enabled: false
Style/RegexpLiteral:
Enabled: false
Rails/Delegate:
Enabled: false
Style/RaiseArgs:
Enabled: false
Rails/HasManyOrHasOneDependent: # Nice to have but challenging to fix
Enabled: false
Rails/InverseOf:
Enabled: false
Style/MultilineBlockChain:
Enabled: false
Naming/AccessorMethodName:
Enabled: false
Naming/PredicateName:
Enabled: false
Style/FormatStringToken:
Enabled: false
Style/RedundantSort: # dangerous since autofix breaks the code
Enabled: false
Style/SymbolProc:
Enabled: false
Rails/ApplicationController:
Enabled: false
Rails/ApplicationRecord:
Enabled: false
Style/ExplicitBlockArgument:
Enabled: false
Rails/DynamicFindBy:
Enabled: false
Metrics/ParameterLists:
Enabled: false
Rails/IndexWith:
Enabled: false
Style/FormatString:
Enabled: false
Rails/Blank:
Enabled: false
Rails/Present:
Enabled: false
Style/NumericLiterals:
Enabled: false
Style/Lambda:
Enabled: false
Style/Proc:
Enabled: false
Style/ExponentialNotation:
Enabled: false
Style/PreferredHashMethods: # can be changed via vote
Enabled: false
Rails/Presence:
Enabled: false
Metrics/ModuleLength:
Enabled: false
Style/RedundantConditional:
Enabled: false
Style/TrailingUnderscoreVariable:
Enabled: false
Style/ParenthesesAroundCondition:
Enabled: false
Style/HashEachMethods:
Enabled: false
Style/RedundantAssignment:
Enabled: false
Style/CaseLikeIf:
Enabled: false
Style/RedundantBegin:
Enabled: false
Rails/FilePath:
Enabled: false
Style/Alias:
Enabled: false
Style/SingleArgumentDig:
Enabled: false
Style/RescueModifier: # because it's heavily used in application service
Enabled: false
Style/IfUnlessModifier:
Enabled: false
Naming/BinaryOperatorParameterName:
Enabled: false
Style/SignalException:
Enabled: false
Style/TrivialAccessors:
Enabled: false
Rails/HasAndBelongsToMany:
Enabled: false
Style/AccessModifierDeclarations:
Enabled: false
Rails/ReadWriteAttribute:
Enabled: false
Rails/RedundantReceiverInWithOptions:
Enabled: false
Style/HashTransformValues:
Enabled: false
Rails/IndexBy:
Enabled: false
Rails/Pick:
Enabled: false
Style/CombinableLoops: # hard to autocorrect properly
Enabled: false
FactoryBot/CreateList:
Enabled: false
Rails/ReflectionClassName:
Enabled: false
Style/RedundantSelf:
Enabled: false
Style/GuardClause:
Enabled: false
Style/PercentLiteralDelimiters:
Enabled: false
Style/StringConcatenation: # heavily used in insurance service
Enabled: false
Style/InverseMethods:
Enabled: false
Style/RedundantInterpolation:
Enabled: false
Style/ZeroLengthPredicate:
Enabled: false
Style/NegatedIf: # sometimes "if !var" just reads better
Enabled: false
Style/NilComparison: # we don't have a good reason to enforce this
Enabled: false
Style/GlobalStdStream: # autocorrection is unsafe because STDOUT and $stdout may point to different objects
Enabled: false
Style/MultilineTernaryOperator:
Enabled: false
Style/RedundantReturn:
Enabled: false
Style/ClassCheck:
Enabled: false
Style/LineEndConcatenation:
Enabled: false
Style/RedundantFetchBlock:
Enabled: false
Style/FloatDivision:
Enabled: false
Layout/MultilineOperationIndentation:
Enabled: false
Style/SoleNestedConditional:
Enabled: false
Rails/FindEach:
Enabled: false
Style/RedundantParentheses:
Enabled: false
Style/IfInsideElse:
Enabled: false
Style/EmptyCaseCondition:
Enabled: false
Style/TernaryParentheses:
EnforcedStyle: require_parentheses_when_complex
Style/HashLikeCase:
Enabled: false
# 🤔 Should we enable these cops or not? They look useful but require alignment within the team
Style/OpenStructUse:
Enabled: false
Style/RedundantConstantBase: # new in 1.40
Enabled: false
Naming/MemoizedInstanceVariableName:
Enabled: false
Style/ConditionalAssignment:
Enabled: false
Style/BlockDelimiters:
Enabled: false
Style/TrailingCommaInArrayLiteral:
Enabled: false
FactoryBot/FactoryClassName:
Enabled: false
Style/NumericLiteralPrefix:
Enabled: false
Style/OptionalBooleanParameter:
Enabled: false
Style/IdenticalConditionalBranches: # Is it safe to auto-fix?
Enabled: false
Naming/RescuedExceptionsVariableName: # Would be nice to have, but should align on the name first
Enabled: false
Naming/MethodParameterName: # should enable but we have to manually fix this
Enabled: false
Rails/UniqueValidationWithoutIndex: # definitely enable!!!
Enabled: false
Rails/Validation: # discuss with the team
Enabled: false
Rails/LexicallyScopedActionFilter: # enable and manually disable offences
Enabled: false
Security/Open:
Enabled: false
Naming/FileName:
Enabled: false
Style/EmptyElse:
Enabled: false
Style/MixinUsage: # Enable and then manually disable offenses?
Enabled: false