simplycop 1.14.6 → 1.14.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,415 @@
1
+ Lint/AmbiguousAssignment:
2
+ Enabled: true
3
+
4
+ Lint/AmbiguousBlockAssociation:
5
+ Exclude:
6
+ - spec/**/*
7
+
8
+ Lint/AmbiguousOperator:
9
+ Enabled: true
10
+
11
+ # Overridden to false in Chopin
12
+ Lint/AmbiguousOperatorPrecedence:
13
+ Enabled: true
14
+
15
+ # Overridden to false in Chopin
16
+ Lint/AmbiguousRange:
17
+ Enabled: true
18
+
19
+ # TODO: One fail on rater spec then would pass
20
+ Lint/AmbiguousRegexpLiteral:
21
+ Enabled: true
22
+
23
+ Lint/AssignmentInCondition:
24
+ Enabled: true
25
+
26
+ Lint/BigDecimalNew:
27
+ Enabled: true
28
+
29
+ Lint/BinaryOperatorWithIdenticalOperands:
30
+ Enabled: true
31
+
32
+ Lint/BooleanSymbol:
33
+ Enabled: true
34
+
35
+ Lint/CircularArgumentReference:
36
+ Enabled: true
37
+
38
+ # TODO: 6 fails in Rater, otherwise clear
39
+ Lint/ConstantDefinitionInBlock:
40
+ Enabled: true
41
+
42
+ Lint/ConstantOverwrittenInRescue: # new in 1.31
43
+ Enabled: true
44
+
45
+ # Set to false as 10000s of fails on Rater and Chopin if enabled
46
+ # Rubocop docs suggest enabling only for constants that may cause concern
47
+ # so enable and set these if required
48
+ Lint/ConstantResolution:
49
+ Enabled: false
50
+
51
+ Lint/Debugger:
52
+ Enabled: true
53
+
54
+ Lint/DeprecatedClassMethods:
55
+ Enabled: true
56
+
57
+ Lint/DeprecatedConstants:
58
+ Enabled: true
59
+
60
+ Lint/DeprecatedOpenSSLConstant:
61
+ Enabled: true
62
+
63
+ Lint/DisjunctiveAssignmentInConstructor:
64
+ Enabled: true
65
+
66
+ Lint/DuplicateBranch:
67
+ Enabled: true
68
+
69
+ Lint/DuplicateCaseCondition:
70
+ Enabled: true
71
+
72
+ Lint/DuplicateElsifCondition:
73
+ Enabled: true
74
+
75
+ Lint/DuplicateHashKey:
76
+ Enabled: true
77
+
78
+ Lint/DuplicateMagicComment:
79
+ Enabled: true
80
+
81
+ Lint/DuplicateMatchPattern:
82
+ Enabled: true
83
+
84
+ Lint/DuplicateMethods:
85
+ Enabled: true
86
+
87
+ Lint/DuplicateRegexpCharacterClassElement:
88
+ Enabled: true
89
+
90
+ Lint/DuplicateRequire:
91
+ Enabled: true
92
+
93
+ Lint/DuplicateRescueException:
94
+ Enabled: true
95
+
96
+ Lint/EachWithObjectArgument:
97
+ Enabled: true
98
+
99
+ Lint/ElseLayout:
100
+ Enabled: true
101
+
102
+ Lint/EmptyBlock:
103
+ Enabled: true
104
+
105
+ Lint/EmptyClass:
106
+ Enabled: true
107
+
108
+ Lint/EmptyConditionalBody:
109
+ Enabled: true
110
+
111
+ Lint/EmptyEnsure:
112
+ Enabled: true
113
+
114
+ Lint/EmptyExpression:
115
+ Enabled: true
116
+
117
+ Lint/EmptyFile:
118
+ Enabled: true
119
+
120
+ Lint/EmptyInPattern: # new in 1.16
121
+ Enabled: true
122
+
123
+ Lint/EmptyInterpolation:
124
+ Enabled: true
125
+
126
+ Lint/EmptyWhen:
127
+ Enabled: true
128
+
129
+ Lint/ErbNewArguments:
130
+ Enabled: true
131
+
132
+ Lint/FlipFlop:
133
+ Enabled: true
134
+
135
+ Lint/FloatComparison:
136
+ Enabled: true
137
+
138
+ Lint/FloatOutOfRange:
139
+ Enabled: true
140
+
141
+ Lint/FormatParameterMismatch:
142
+ Enabled: true
143
+
144
+ Lint/HashCompareByIdentity:
145
+ Enabled: true
146
+
147
+ Lint/HeredocMethodCallPosition:
148
+ Enabled: true
149
+
150
+ Lint/IdentityComparison:
151
+ Enabled: true
152
+
153
+ Lint/ImplicitStringConcatenation:
154
+ Enabled: true
155
+
156
+ Lint/IncompatibleIoSelectWithFiberScheduler: # new in 1.21
157
+ Enabled: true
158
+
159
+ # TODO: two fails on Rater, one on CoCo, otherwise fine
160
+ Lint/IneffectiveAccessModifier:
161
+ Enabled: true
162
+
163
+ Lint/InheritException:
164
+ Enabled: true
165
+
166
+ Lint/InterpolationCheck:
167
+ Enabled: true
168
+
169
+ Lint/LambdaWithoutLiteralBlock:
170
+ Enabled: true
171
+
172
+ Lint/LiteralAsCondition:
173
+ Enabled: true
174
+
175
+ Lint/LiteralInInterpolation:
176
+ Enabled: true
177
+
178
+ Lint/Loop:
179
+ Enabled: true
180
+
181
+ Lint/MissingCopEnableDirective:
182
+ Enabled: true
183
+
184
+ # TODO: Handful of errors on Rater and CoCo
185
+ Lint/MissingSuper:
186
+ Enabled: true
187
+
188
+ Lint/MixedCaseRange:
189
+ Enabled: true
190
+
191
+ Lint/MixedRegexpCaptureTypes:
192
+ Enabled: true
193
+
194
+ Lint/MultipleComparison:
195
+ Enabled: true
196
+
197
+ Lint/NestedMethodDefinition:
198
+ Enabled: true
199
+
200
+ Lint/NestedPercentLiteral:
201
+ Enabled: true
202
+
203
+ Lint/NextWithoutAccumulator:
204
+ Enabled: true
205
+
206
+ Lint/NoReturnInBeginEndBlocks:
207
+ Enabled: true
208
+
209
+ # Overridden to false in Chopin
210
+ Lint/NonAtomicFileOperation:
211
+ Enabled: true
212
+
213
+ Lint/NonDeterministicRequireOrder:
214
+ Enabled: true
215
+
216
+ Lint/NonLocalExitFromIterator:
217
+ Enabled: true
218
+
219
+ Lint/NumberConversion:
220
+ Enabled: false
221
+
222
+ Lint/NumberedParameterAssignment:
223
+ Enabled: true
224
+
225
+ Lint/OrAssignmentToConstant:
226
+ Enabled: true
227
+
228
+ Lint/OrderedMagicComments:
229
+ Enabled: true
230
+
231
+ Lint/OutOfRangeRegexpRef:
232
+ Enabled: true
233
+
234
+ Lint/ParenthesesAsGroupedExpression:
235
+ Enabled: true
236
+
237
+ Lint/PercentStringArray:
238
+ Enabled: true
239
+
240
+ Lint/PercentSymbolArray:
241
+ Enabled: true
242
+
243
+ Lint/RaiseException:
244
+ Enabled: true
245
+
246
+ Lint/RandOne:
247
+ Enabled: true
248
+
249
+ Lint/RedundantCopDisableDirective:
250
+ Enabled: true
251
+
252
+ Lint/RedundantCopEnableDirective:
253
+ Enabled: true
254
+
255
+ Lint/RedundantDirGlobSort:
256
+ Enabled: true
257
+
258
+ Lint/RedundantRegexpQuantifiers:
259
+ Enabled: true
260
+
261
+ Lint/RedundantRequireStatement:
262
+ Enabled: true
263
+
264
+ Lint/RedundantSafeNavigation:
265
+ Enabled: true
266
+
267
+ Lint/RedundantSplatExpansion:
268
+ Enabled: true
269
+
270
+ Lint/RedundantStringCoercion:
271
+ Enabled: true
272
+
273
+ Lint/RedundantWithIndex:
274
+ Enabled: true
275
+
276
+ Lint/RedundantWithObject:
277
+ Enabled: true
278
+
279
+ Lint/RefinementImportMethods:
280
+ Enabled: true
281
+
282
+ Lint/RegexpAsCondition:
283
+ Enabled: true
284
+
285
+ Lint/RequireParentheses:
286
+ Enabled: true
287
+
288
+ Lint/RequireRangeParentheses:
289
+ Enabled: true
290
+
291
+ # Overridden to false in Chopin
292
+ Lint/RequireRelativeSelfPath:
293
+ Enabled: true
294
+
295
+ Lint/RescueException:
296
+ Enabled: true
297
+
298
+ Lint/RescueType:
299
+ Enabled: true
300
+
301
+ Lint/ReturnInVoidContext:
302
+ Enabled: true
303
+
304
+ Lint/SafeNavigationChain:
305
+ Enabled: true
306
+
307
+ Lint/SafeNavigationConsistency:
308
+ Enabled: true
309
+
310
+ Lint/SafeNavigationWithEmpty:
311
+ Enabled: true
312
+
313
+ Lint/ScriptPermission:
314
+ Enabled: true
315
+
316
+ Lint/SelfAssignment:
317
+ Enabled: true
318
+
319
+ Lint/SendWithMixinArgument:
320
+ Enabled: true
321
+
322
+ Lint/ShadowedArgument:
323
+ Enabled: true
324
+
325
+ Lint/ShadowedException:
326
+ Enabled: true
327
+
328
+ # Needs Chopin override
329
+ Lint/ShadowingOuterLocalVariable:
330
+ Enabled: true
331
+
332
+ Lint/StructNewOverride:
333
+ Enabled: true
334
+
335
+ Lint/SuppressedException:
336
+ Enabled: true
337
+
338
+ Lint/SymbolConversion:
339
+ Enabled: true
340
+
341
+ Lint/Syntax:
342
+ Enabled: true
343
+
344
+ Lint/ToEnumArguments:
345
+ Enabled: true
346
+
347
+ Lint/ToJSON:
348
+ Enabled: true
349
+
350
+ Lint/TopLevelReturnWithArgument:
351
+ Enabled: true
352
+
353
+ Lint/TrailingCommaInAttributeDeclaration:
354
+ Enabled: true
355
+
356
+ Lint/TripleQuotes:
357
+ Enabled: true
358
+
359
+ Lint/UnderscorePrefixedVariableName:
360
+ Enabled: true
361
+
362
+ Lint/UnexpectedBlockArity:
363
+ Enabled: true
364
+
365
+ Lint/UnifiedInteger:
366
+ Enabled: true
367
+
368
+ Lint/UnmodifiedReduceAccumulator:
369
+ Enabled: true
370
+
371
+ Lint/UnreachableCode:
372
+ Enabled: true
373
+
374
+ Lint/UnreachableLoop:
375
+ Enabled: true
376
+
377
+ Lint/UnusedBlockArgument:
378
+ Enabled: true
379
+
380
+ Lint/UnusedMethodArgument:
381
+ Enabled: true
382
+
383
+ Lint/UriEscapeUnescape:
384
+ Enabled: true
385
+
386
+ Lint/UriRegexp:
387
+ Enabled: true
388
+
389
+ Lint/UselessAccessModifier:
390
+ Enabled: true
391
+
392
+ Lint/UselessAssignment:
393
+ Enabled: true
394
+
395
+ Lint/UselessElseWithoutRescue:
396
+ Enabled: true
397
+
398
+ Lint/UselessMethodDefinition:
399
+ Enabled: true
400
+
401
+ # TODO: Single fail on Chopin
402
+ Lint/UselessRescue:
403
+ Enabled: true
404
+
405
+ Lint/UselessRuby2Keywords:
406
+ Enabled: true
407
+
408
+ Lint/UselessSetterCall:
409
+ Enabled: true
410
+
411
+ Lint/UselessTimes:
412
+ Enabled: true
413
+
414
+ Lint/Void:
415
+ Enabled: true
@@ -0,0 +1,38 @@
1
+ # Metrics cops are enabled by default with the expectation that many repos will
2
+ # have to set their own limits or disable. #technical-excellence-community discussion
3
+ # suggested some liked to work from them, and that overriding should be a conscious decision
4
+
5
+ Metrics/AbcSize:
6
+ Enabled: true
7
+
8
+ Metrics/BlockLength:
9
+ Enabled: true
10
+ Exclude:
11
+ - spec/**/*.rb
12
+
13
+ Metrics/BlockNesting:
14
+ Enabled: true
15
+
16
+ Metrics/ClassLength:
17
+ Enabled: true
18
+
19
+ Metrics/CollectionLiteralLength:
20
+ Enabled: true
21
+
22
+ Metrics/CyclomaticComplexity:
23
+ Enabled: true
24
+
25
+ Metrics/MethodLength:
26
+ Enabled: true
27
+ Exclude:
28
+ - spec/**/*.rb
29
+
30
+ Metrics/ModuleLength:
31
+ Enabled: true
32
+
33
+ Metrics/ParameterLists:
34
+ CountKeywordArgs: false
35
+ Enabled: true
36
+
37
+ Metrics/PerceivedComplexity:
38
+ Enabled: true
@@ -0,0 +1,2 @@
1
+ Migration/DepartmentName:
2
+ Enabled: true
@@ -0,0 +1,81 @@
1
+ # Needs override or fix in Chopin
2
+ Naming/AccessorMethodName:
3
+ Enabled: true
4
+
5
+ Naming/AsciiIdentifiers:
6
+ Enabled: true
7
+
8
+ Naming/BinaryOperatorParameterName:
9
+ Enabled: true
10
+
11
+ Naming/BlockForwarding:
12
+ Enabled: true
13
+
14
+ Naming/BlockParameterName:
15
+ Enabled: true
16
+
17
+ Naming/ClassAndModuleCamelCase:
18
+ Enabled: true
19
+
20
+ Naming/ConstantName:
21
+ Enabled: true
22
+
23
+ Naming/FileName:
24
+ Enabled: true
25
+
26
+ Naming/HeredocDelimiterCase:
27
+ Enabled: true
28
+
29
+ Naming/HeredocDelimiterNaming:
30
+ Enabled: true
31
+
32
+ Naming/InclusiveLanguage:
33
+ Enabled: true
34
+
35
+ # Need override - 86 fails on Chopin
36
+ Naming/MemoizedInstanceVariableName:
37
+ Enabled: true
38
+
39
+ Naming/MethodName:
40
+ Enabled: true
41
+
42
+ Naming/MethodParameterName:
43
+ Enabled: true
44
+ AllowedNames:
45
+ - as
46
+ - at
47
+ - ex
48
+ - id
49
+ - ip
50
+ - n
51
+ - to
52
+
53
+ Naming/PredicateName:
54
+ Enabled: true
55
+ ForbiddenPrefixes: []
56
+
57
+ # Need Chopin override
58
+ Naming/RescuedExceptionsVariableName:
59
+ Enabled: true
60
+
61
+ Naming/VariableName:
62
+ Enabled: true
63
+
64
+ # snake_case: 311 fails on Chopin, normalcase: 1118 fails on Chopin
65
+ # snake_case default on Rater so make default in simplycop
66
+ Naming/VariableNumber:
67
+ Enabled: true
68
+ EnforcedStyle: snake_case
69
+ AllowedIdentifiers:
70
+ - capture3
71
+ - e164
72
+ - iso8601
73
+ - oauth2
74
+ - rfc1123_date
75
+ - rfc822
76
+ - rfc2822
77
+ - rfc3339
78
+ - s3
79
+ - x86_64
80
+ AllowedPatterns:
81
+ - v\d+
data/.simplycop_rspec.yml CHANGED
@@ -126,6 +126,9 @@ RSpec/ExpectInHook:
126
126
  RSpec/ExpectOutput:
127
127
  Enabled: false
128
128
 
129
+ RSpec/FilePath:
130
+ Enabled: false
131
+
129
132
  RSpec/Focus:
130
133
  Enabled: true
131
134
 
@@ -186,7 +189,7 @@ RSpec/MessageSpies:
186
189
  Enabled: false
187
190
 
188
191
  RSpec/MetadataStyle:
189
- Enabled: true
192
+ Enabled: false
190
193
 
191
194
  RSpec/MissingExampleGroupArgument:
192
195
  Enabled: true
@@ -280,12 +283,12 @@ RSpec/SkipBlockInsideExample:
280
283
  RSpec/SortMetadata:
281
284
  Enabled: true
282
285
 
283
- RSpec/SpecFilePathSuffix:
284
- Enabled: false
285
-
286
286
  RSpec/SpecFilePathFormat:
287
287
  Enabled: false
288
288
 
289
+ RSpec/SpecFilePathSuffix:
290
+ Enabled: true
291
+
289
292
  RSpec/StubbedMock:
290
293
  Enabled: false
291
294
 
@@ -315,15 +318,19 @@ RSpec/Yield:
315
318
 
316
319
  # Rspec/Capybara
317
320
 
321
+ # Similar to FactoryBot (see below) there is an RSpec/Capybara department and a separate Capybara
322
+ # package which is not installed in simplycop. This configuration is just for the RSpec department.
323
+ # The namespacing has been changed to avoid warnings.
324
+
318
325
  RSpec/Capybara:
319
326
  Enabled: true
320
327
  Include:
321
328
  - spec/integration/*.rb
322
329
 
323
- RSpec/Capybara/FeatureMethods:
330
+ Capybara/CurrentPathExpectation:
324
331
  Enabled: true
325
332
 
326
- Capybara/CurrentPathExpectation:
333
+ RSpec/Capybara/FeatureMethods:
327
334
  Enabled: true
328
335
 
329
336
  Capybara/MatchStyle:
@@ -341,11 +348,13 @@ Capybara/SpecificFinders:
341
348
  Capybara/SpecificMatcher:
342
349
  Enabled: true
343
350
 
344
- # RSpec/FactoryBot
345
-
346
- FactoryBot/AssociationStyle:
351
+ Capybara/VisibilityMatcher:
347
352
  Enabled: true
348
353
 
354
+ # RSpec/FactoryBot
355
+ # NB: There is an RSpec/FactoryBot department and a separate FactoryBot package. The FactoryBot package is
356
+ # not installed on simplycop. The configuration is just for the RSpec department, namespaced to avoid warnings.
357
+
349
358
  FactoryBot/AttributeDefinedStatically:
350
359
  Enabled: true
351
360
 
@@ -355,22 +364,51 @@ FactoryBot/ConsistentParenthesesStyle:
355
364
  FactoryBot/CreateList:
356
365
  Enabled: false
357
366
 
358
- FactoryBot/FactoryAssociationWithStrategy:
359
- Enabled: true
360
-
361
367
  FactoryBot/FactoryClassName:
362
368
  Enabled: true
363
369
 
364
370
  FactoryBot/FactoryNameStyle:
365
371
  Enabled: true
366
372
 
367
- FactoryBot/RedundantFactoryOption:
368
- Enabled: true
369
-
370
373
  # Prefer explicit factorybot call
371
374
  FactoryBot/SyntaxMethods:
372
375
  Enabled: false
373
376
 
377
+ # Previously some FactoryBot package cops were configured due to the above confusion. There is less crossover between
378
+ # RSpec/FactoryBot and FactoryBot than Capybara, so it generated a number of errors when they weren't found.
379
+ # This is how they were configured:
380
+
381
+ # FactoryBot/AssociationStyle:
382
+ # Enabled: true
383
+
384
+ # FactoryBot/AttributeDefinedStatically:
385
+ # Enabled: true
386
+
387
+ # FactoryBot/ConsistentParenthesesStyle:
388
+ # Enabled: true
389
+
390
+ # FactoryBot/CreateList:
391
+ # Enabled: false
392
+
393
+ # FactoryBot/FactoryAssociationWithStrategy:
394
+ # Enabled: true
395
+
396
+ # FactoryBot/FactoryClassName:
397
+ # Enabled: true
398
+
399
+ # FactoryBot/FactoryNameStyle:
400
+ # Enabled: true
401
+
402
+ # FactoryBot/IdSequence:
403
+ # Enabled: true
404
+
405
+ # FactoryBot/RedundantFactoryOption:
406
+ # Enabled: true
407
+
408
+ # # Prefer explicit factorybot call
409
+ # FactoryBot/SyntaxMethods:
410
+ # Enabled: false
411
+
374
412
  # Rspec/Rails
375
413
 
376
414
  RSpec/Rails/AvoidSetupHook: # new in 2.4
@@ -3,6 +3,8 @@ require:
3
3
  - './lib/simplycop/security/reject_all_requests_local.rb'
4
4
  - './lib/simplycop/security/check_for_vulnerable_code.rb'
5
5
 
6
+ # Custom security cops
7
+
6
8
  Security/CSRFTokenValidation:
7
9
  Enabled: true
8
10
  Details: >-
@@ -20,3 +22,31 @@ Security/CheckForVulnerableCode:
20
22
  Details: >-
21
23
  Please make sure that this is addressed accordingly.
22
24
  Do not hesitate to contact infosec for help and guidance
25
+
26
+ # Standard security cops
27
+
28
+ # Overridden to false in Chopin
29
+ Security/CompoundHash:
30
+ Enabled: true
31
+
32
+ Security/Eval:
33
+ Enabled: true
34
+ Exclude:
35
+ - 'spec/**/*.rb'
36
+
37
+ # Overridden to false on Chopin
38
+ Security/IoMethods:
39
+ Enabled: true
40
+
41
+ # Needs override in chopin spec
42
+ Security/JSONLoad:
43
+ Enabled: true
44
+
45
+ Security/MarshalLoad:
46
+ Enabled: true
47
+
48
+ Security/Open:
49
+ Enabled: true
50
+
51
+ Security/YAMLLoad:
52
+ Enabled: true