simplycop 1.2.0 → 1.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.custom_simplycop.yml +6 -0
- data/.github/dependabot.yml +18 -0
- data/.github/workflows/version_forget_me_not.yml +1 -1
- data/.simplycop.yml +164 -205
- data/.simplycop_metaprogramming.yml +0 -3
- data/.simplycop_rails.yml +13 -59
- data/.simplycop_rspec.yml +1 -187
- data/.simplycop_security.yml +0 -3
- data/lib/simplycop/custom_cops/dont_print_all_env.rb +36 -0
- data/lib/simplycop/version.rb +1 -1
- data/simplycop.gemspec +2 -2
- metadata +9 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 076036bcf8a50fab9721ef1a9bc81c58c1b37be20b72b6882fbbcd55505f7071
|
4
|
+
data.tar.gz: f246b21e0afd394b49dbafd4445c90734f6232488d7d1578a4e3b118dff9ef53
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a19db9f0d33d7b4a376c3e54d3d08f58dad4c891f1349f5c4edb26e04e16b8b21aadf766fcaaef28d16fb113959d755676fa4e5b3fa7d04dc631b99cfffcb02c
|
7
|
+
data.tar.gz: 723b0bb560e8fb0a229b131abba0ee984bb84f6aeb21500fa3dc9d7d25157a0d457f430ada57a8c3737d24218e95e3873efc317a0140da62624aac2cc295fa6f
|
data/.custom_simplycop.yml
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require:
|
2
2
|
- './lib/simplycop/custom_cops/timecop_without_block.rb'
|
3
|
+
- './lib/simplycop/custom_cops/dont_print_all_env.rb'
|
3
4
|
|
4
5
|
AllCops:
|
5
6
|
ExtraDetails: true
|
@@ -9,3 +10,8 @@ CustomCops/TimecopWithoutBlock:
|
|
9
10
|
Details: >-
|
10
11
|
Time in all tests is faked to be midday. Using `Timecop.return` rather than the block format will spoil that for all subsequent tests.
|
11
12
|
`https://github.com/simplybusiness/chopin/pull/10607`
|
13
|
+
|
14
|
+
CustomCops/DontPrintAllEnv:
|
15
|
+
Enabled: true
|
16
|
+
Details: >-
|
17
|
+
This cop checks if someone accidentally print all environment variables as they may contain secrets.
|
@@ -0,0 +1,18 @@
|
|
1
|
+
version: 2
|
2
|
+
updates:
|
3
|
+
- package-ecosystem: bundler
|
4
|
+
directory: "/"
|
5
|
+
schedule:
|
6
|
+
interval: daily
|
7
|
+
time: "05:00"
|
8
|
+
open-pull-requests-limit: 99
|
9
|
+
labels:
|
10
|
+
- dependencies
|
11
|
+
- package-ecosystem: github-actions
|
12
|
+
directory: "/"
|
13
|
+
schedule:
|
14
|
+
interval: daily
|
15
|
+
time: "05:00"
|
16
|
+
open-pull-requests-limit: 99
|
17
|
+
labels:
|
18
|
+
- dependencies
|
data/.simplycop.yml
CHANGED
@@ -18,436 +18,395 @@ AllCops:
|
|
18
18
|
DisplayStyleGuide: true
|
19
19
|
UseCache: true
|
20
20
|
MaxFilesInCache: 5000
|
21
|
+
ExtraDetails: true
|
21
22
|
# Adapted from: https://github.com/simplybusiness/how-we-roll/blob/master/development/RUBYSTYLEGUIDE.markdown
|
22
23
|
|
23
|
-
|
24
|
+
Layout/EmptyLineAfterMultilineCondition:
|
24
25
|
Enabled: true
|
25
|
-
EnforcedStyle: snake_case
|
26
|
-
SupportedStyles:
|
27
|
-
- snake_case
|
28
|
-
- camelCase
|
29
26
|
|
30
|
-
|
27
|
+
Layout/FirstArrayElementLineBreak:
|
31
28
|
Enabled: true
|
32
29
|
|
33
|
-
Layout/
|
30
|
+
Layout/FirstMethodArgumentLineBreak:
|
34
31
|
Enabled: true
|
35
|
-
Severity: warning
|
36
32
|
|
37
|
-
Layout/
|
33
|
+
Layout/FirstHashElementLineBreak:
|
38
34
|
Enabled: true
|
39
|
-
Severity: warning
|
40
35
|
|
41
|
-
|
36
|
+
Layout/HeredocArgumentClosingParenthesis:
|
42
37
|
Enabled: true
|
43
|
-
Severity: warning
|
44
38
|
|
45
|
-
|
39
|
+
Layout/SpaceBeforeBrackets:
|
46
40
|
Enabled: true
|
47
|
-
Severity: warning
|
48
|
-
|
49
|
-
Style/ColonMethodCall:
|
50
|
-
Enabled: true
|
51
|
-
Severity: warning
|
52
41
|
|
53
|
-
|
54
|
-
Enabled: true
|
55
|
-
Severity: warning
|
42
|
+
###### COPS REVIEWED ABOVE THIS LINE ######
|
56
43
|
|
57
|
-
|
44
|
+
Lint/AmbiguousAssignment:
|
58
45
|
Enabled: true
|
59
46
|
|
60
|
-
|
61
|
-
|
47
|
+
Lint/AmbiguousBlockAssociation:
|
48
|
+
Exclude:
|
49
|
+
- spec/**/*
|
62
50
|
|
63
|
-
|
51
|
+
Lint/AmbiguousOperator:
|
64
52
|
Enabled: true
|
65
53
|
|
66
|
-
|
67
|
-
Enabled: false
|
68
|
-
|
69
|
-
Layout/AssignmentIndentation:
|
54
|
+
Lint/AmbiguousRegexpLiteral:
|
70
55
|
Enabled: true
|
71
56
|
|
72
|
-
|
73
|
-
Enabled: false
|
74
|
-
|
75
|
-
Style/ZeroLengthPredicate:
|
57
|
+
Lint/BinaryOperatorWithIdenticalOperands:
|
76
58
|
Enabled: true
|
77
59
|
|
78
|
-
|
60
|
+
Lint/CircularArgumentReference:
|
79
61
|
Enabled: true
|
80
62
|
|
81
|
-
|
63
|
+
Lint/ConstantDefinitionInBlock:
|
82
64
|
Enabled: true
|
65
|
+
Exclude:
|
66
|
+
- spec/**/*.rb
|
83
67
|
|
84
|
-
|
68
|
+
Lint/DeprecatedClassMethods:
|
85
69
|
Enabled: true
|
86
70
|
|
87
|
-
Lint/
|
88
|
-
Enabled: false
|
89
|
-
|
90
|
-
Lint/ImplicitStringConcatenation:
|
71
|
+
Lint/DeprecatedConstants:
|
91
72
|
Enabled: true
|
92
73
|
|
93
|
-
Lint/
|
74
|
+
Lint/DeprecatedOpenSSLConstant:
|
94
75
|
Enabled: true
|
95
|
-
Severity: warning
|
96
76
|
|
97
|
-
Lint/
|
77
|
+
Lint/DuplicateBranch:
|
98
78
|
Enabled: true
|
99
|
-
Severity: warning
|
100
79
|
|
101
|
-
Lint/
|
80
|
+
Lint/DuplicateElsifCondition:
|
102
81
|
Enabled: true
|
103
|
-
Severity: warning
|
104
82
|
|
105
|
-
|
106
|
-
Enabled: false
|
107
|
-
|
108
|
-
Layout/SpaceInsideBlockBraces:
|
83
|
+
Lint/DuplicateHashKey:
|
109
84
|
Enabled: false
|
110
85
|
|
111
|
-
|
112
|
-
Enabled: true
|
113
|
-
|
114
|
-
Layout/SpaceInsideReferenceBrackets:
|
86
|
+
Lint/DuplicateMethods:
|
115
87
|
Enabled: true
|
88
|
+
Severity: warning
|
116
89
|
|
117
|
-
|
118
|
-
Enabled: false
|
119
|
-
|
120
|
-
Layout/SpaceInsideParens:
|
90
|
+
Lint/DuplicateRegexpCharacterClassElement:
|
121
91
|
Enabled: true
|
122
92
|
|
123
|
-
|
93
|
+
Lint/DuplicateRequire:
|
124
94
|
Enabled: true
|
125
95
|
|
126
|
-
|
96
|
+
Lint/DuplicateRescueException:
|
127
97
|
Enabled: true
|
128
98
|
|
129
|
-
|
99
|
+
Lint/EmptyBlock:
|
130
100
|
Enabled: true
|
131
101
|
|
132
|
-
|
102
|
+
Lint/EmptyClass:
|
133
103
|
Enabled: true
|
134
104
|
|
135
|
-
|
105
|
+
Lint/EmptyConditionalBody:
|
136
106
|
Enabled: true
|
137
107
|
|
138
|
-
|
108
|
+
Lint/EmptyFile:
|
139
109
|
Enabled: true
|
140
110
|
|
141
|
-
|
111
|
+
Lint/FloatComparison:
|
142
112
|
Enabled: true
|
143
113
|
|
144
|
-
|
145
|
-
EnforcedStyle: brackets
|
146
|
-
|
147
|
-
Style/WordArray:
|
148
|
-
EnforcedStyle: brackets
|
149
|
-
|
150
|
-
Style/ParenthesesAroundCondition:
|
114
|
+
Lint/IdentityComparison:
|
151
115
|
Enabled: true
|
152
116
|
|
153
|
-
|
117
|
+
Lint/ImplicitStringConcatenation:
|
154
118
|
Enabled: true
|
155
119
|
|
156
|
-
|
157
|
-
Enabled:
|
120
|
+
Lint/IneffectiveAccessModifier:
|
121
|
+
Enabled: false
|
158
122
|
|
159
|
-
|
123
|
+
Lint/LambdaWithoutLiteralBlock:
|
160
124
|
Enabled: true
|
161
125
|
|
162
|
-
Lint/
|
126
|
+
Lint/MissingSuper:
|
163
127
|
Enabled: false
|
164
128
|
|
165
|
-
Lint/
|
129
|
+
Lint/MixedRegexpCaptureTypes:
|
166
130
|
Enabled: true
|
167
131
|
|
168
|
-
Lint/
|
132
|
+
Lint/NoReturnInBeginEndBlocks:
|
169
133
|
Enabled: true
|
170
134
|
|
171
|
-
Lint/
|
135
|
+
Lint/OutOfRangeRegexpRef:
|
172
136
|
Enabled: true
|
173
137
|
|
174
|
-
|
138
|
+
Lint/RaiseException:
|
175
139
|
Enabled: true
|
176
140
|
|
177
|
-
|
141
|
+
Lint/RedundantDirGlobSort:
|
178
142
|
Enabled: true
|
179
143
|
|
180
|
-
Lint/
|
144
|
+
Lint/SelfAssignment:
|
181
145
|
Enabled: true
|
182
146
|
|
183
|
-
|
147
|
+
Lint/StructNewOverride:
|
184
148
|
Enabled: true
|
185
149
|
|
186
|
-
Lint/
|
187
|
-
Enabled: false
|
188
|
-
|
189
|
-
Lint/Void:
|
150
|
+
Lint/ToEnumArguments:
|
190
151
|
Enabled: true
|
191
152
|
|
192
|
-
|
193
|
-
Enabled: false
|
194
|
-
|
195
|
-
Layout/SpaceAroundBlockParameters:
|
153
|
+
Lint/TopLevelReturnWithArgument:
|
196
154
|
Enabled: true
|
197
155
|
|
198
|
-
|
156
|
+
Lint/TrailingCommaInAttributeDeclaration:
|
199
157
|
Enabled: true
|
200
158
|
|
201
|
-
|
159
|
+
Lint/UnderscorePrefixedVariableName:
|
202
160
|
Enabled: true
|
161
|
+
Severity: warning
|
203
162
|
|
204
|
-
|
163
|
+
Lint/UnexpectedBlockArity:
|
205
164
|
Enabled: true
|
206
165
|
|
207
|
-
|
166
|
+
Lint/UnmodifiedReduceAccumulator:
|
208
167
|
Enabled: true
|
209
168
|
|
210
|
-
|
169
|
+
Lint/UnreachableLoop:
|
211
170
|
Enabled: true
|
212
171
|
|
213
|
-
|
172
|
+
Lint/UnusedBlockArgument:
|
214
173
|
Enabled: true
|
174
|
+
Severity: warning
|
215
175
|
|
216
|
-
|
217
|
-
Enabled:
|
176
|
+
Lint/UselessAccessModifier:
|
177
|
+
Enabled: false
|
218
178
|
|
219
|
-
|
179
|
+
Lint/UselessAssignment:
|
220
180
|
Enabled: true
|
181
|
+
Severity: warning
|
221
182
|
|
222
|
-
|
223
|
-
Enabled:
|
224
|
-
|
225
|
-
Style/GuardClause:
|
226
|
-
Enabled: false
|
183
|
+
Lint/UselessMethodDefinition:
|
184
|
+
Enabled: true
|
227
185
|
|
228
|
-
|
229
|
-
Enabled:
|
186
|
+
Lint/UselessTimes:
|
187
|
+
Enabled: true
|
230
188
|
|
231
|
-
|
232
|
-
Enabled:
|
189
|
+
Lint/Void:
|
190
|
+
Enabled: true
|
233
191
|
|
192
|
+
Metrics/BlockLength:
|
193
|
+
Exclude:
|
194
|
+
- spec/**/*.rb
|
195
|
+
-
|
234
196
|
Metrics/ClassLength:
|
235
197
|
Max: 512
|
236
198
|
Enabled: true
|
237
199
|
|
238
|
-
|
200
|
+
Metrics/ModuleLength:
|
239
201
|
Enabled: true
|
240
|
-
Max: 120
|
241
202
|
|
242
|
-
|
203
|
+
Naming/FileName:
|
243
204
|
Enabled: true
|
244
205
|
|
245
|
-
|
246
|
-
Enabled: false
|
247
|
-
|
248
|
-
Style/HashTransformKeys:
|
206
|
+
Naming/VariableName:
|
249
207
|
Enabled: true
|
208
|
+
EnforcedStyle: snake_case
|
209
|
+
SupportedStyles:
|
210
|
+
- snake_case
|
211
|
+
- camelCase
|
250
212
|
|
251
|
-
Style/
|
213
|
+
Style/AccessorGrouping:
|
252
214
|
Enabled: true
|
253
215
|
|
254
|
-
|
255
|
-
Enabled:
|
216
|
+
Style/Alias:
|
217
|
+
Enabled: false
|
256
218
|
|
257
|
-
|
219
|
+
Style/ArgumentsForwarding:
|
258
220
|
Enabled: true
|
259
221
|
|
260
|
-
|
222
|
+
Style/ArrayCoercion:
|
261
223
|
Enabled: true
|
262
224
|
|
263
|
-
|
225
|
+
Style/BisectedAttrAccessor:
|
264
226
|
Enabled: true
|
265
227
|
|
266
|
-
|
228
|
+
Style/CaseLikeIf:
|
267
229
|
Enabled: true
|
268
230
|
|
269
|
-
|
231
|
+
Style/CollectionCompact:
|
270
232
|
Enabled: true
|
271
233
|
|
272
|
-
|
234
|
+
Style/ColonMethodCall:
|
273
235
|
Enabled: true
|
236
|
+
Severity: warning
|
274
237
|
|
275
|
-
Style/
|
238
|
+
Style/CombinableLoops:
|
276
239
|
Enabled: true
|
277
240
|
|
278
|
-
Style/
|
241
|
+
Style/ConditionalAssignment:
|
279
242
|
Enabled: true
|
280
243
|
|
281
|
-
Style/
|
244
|
+
Style/DocumentDynamicEvalDefinition:
|
245
|
+
Enabled: false
|
246
|
+
|
247
|
+
Style/Documentation:
|
248
|
+
Enabled: false
|
249
|
+
|
250
|
+
Style/EndlessMethod:
|
282
251
|
Enabled: true
|
283
252
|
|
284
|
-
Style/
|
253
|
+
Style/ExplicitBlockArgument:
|
285
254
|
Enabled: true
|
286
255
|
|
287
256
|
Style/ExponentialNotation:
|
288
257
|
Enabled: false
|
289
258
|
|
290
|
-
Style/
|
259
|
+
Style/For:
|
291
260
|
Enabled: true
|
292
261
|
|
293
|
-
Style/
|
262
|
+
Style/FormatString:
|
294
263
|
Enabled: false
|
295
264
|
|
296
|
-
Style/
|
297
|
-
Enabled:
|
265
|
+
Style/FormatStringToken:
|
266
|
+
Enabled: false
|
298
267
|
|
299
|
-
Style/
|
300
|
-
Enabled:
|
268
|
+
Style/FrozenStringLiteralComment:
|
269
|
+
Enabled: false
|
301
270
|
|
302
|
-
Style/
|
271
|
+
Style/GlobalStdStream:
|
303
272
|
Enabled: true
|
304
273
|
|
305
|
-
Style/
|
306
|
-
Enabled:
|
274
|
+
Style/GuardClause:
|
275
|
+
Enabled: false
|
307
276
|
|
308
|
-
Style/
|
277
|
+
Style/HashAsLastArrayItem:
|
309
278
|
Enabled: true
|
310
279
|
|
311
|
-
Style/
|
280
|
+
Style/HashEachMethods:
|
312
281
|
Enabled: false
|
313
282
|
|
314
|
-
|
283
|
+
Style/HashExcept:
|
315
284
|
Enabled: true
|
316
285
|
|
317
|
-
|
318
|
-
Enabled:
|
286
|
+
Style/HashLikeCase:
|
287
|
+
Enabled: false
|
319
288
|
|
320
|
-
|
289
|
+
Style/HashTransformKeys:
|
321
290
|
Enabled: true
|
322
|
-
Exclude:
|
323
|
-
- spec/**/*.rb
|
324
291
|
|
325
|
-
|
292
|
+
Style/HashTransformValues:
|
326
293
|
Enabled: true
|
327
294
|
|
328
|
-
|
295
|
+
Style/IfInsideElse:
|
329
296
|
Enabled: true
|
330
297
|
|
331
|
-
|
298
|
+
Style/KeywordParametersOrder:
|
332
299
|
Enabled: true
|
333
300
|
|
334
|
-
|
301
|
+
Style/LambdaCall:
|
335
302
|
Enabled: true
|
336
303
|
|
337
|
-
|
304
|
+
Style/MethodDefParentheses:
|
338
305
|
Enabled: true
|
339
306
|
|
340
|
-
|
307
|
+
Style/MultilineTernaryOperator:
|
341
308
|
Enabled: true
|
342
309
|
|
343
|
-
|
310
|
+
Style/MutableConstant:
|
344
311
|
Enabled: false
|
345
312
|
|
346
|
-
|
313
|
+
Style/NegatedIfElseCondition:
|
347
314
|
Enabled: true
|
348
315
|
|
349
|
-
|
316
|
+
Style/NestedModifier:
|
350
317
|
Enabled: true
|
351
318
|
|
352
|
-
|
319
|
+
Style/NestedParenthesizedCalls:
|
353
320
|
Enabled: true
|
354
321
|
|
355
|
-
|
322
|
+
Style/NestedTernaryOperator:
|
356
323
|
Enabled: true
|
357
324
|
|
358
|
-
|
325
|
+
Style/NilLambda:
|
359
326
|
Enabled: true
|
360
327
|
|
361
|
-
|
362
|
-
Enabled:
|
328
|
+
Style/NumericPredicate:
|
329
|
+
Enabled: false
|
363
330
|
|
364
|
-
|
331
|
+
Style/OptionalArguments:
|
365
332
|
Enabled: true
|
366
333
|
|
367
|
-
Style/
|
334
|
+
Style/OptionalBooleanParameter:
|
368
335
|
Enabled: true
|
369
336
|
|
370
|
-
Style/
|
337
|
+
Style/ParenthesesAroundCondition:
|
371
338
|
Enabled: true
|
372
339
|
|
373
|
-
Style/
|
340
|
+
Style/RedundantArgument:
|
374
341
|
Enabled: true
|
375
342
|
|
376
|
-
Style/
|
343
|
+
Style/RedundantAssignment:
|
377
344
|
Enabled: true
|
378
345
|
|
379
|
-
Style/
|
346
|
+
Style/RedundantBegin:
|
380
347
|
Enabled: true
|
381
348
|
|
382
|
-
Style/
|
349
|
+
Style/RedundantException:
|
383
350
|
Enabled: true
|
384
351
|
|
385
|
-
Style/
|
352
|
+
Style/RedundantFetchBlock:
|
386
353
|
Enabled: true
|
387
354
|
|
388
|
-
Style/
|
355
|
+
Style/RedundantFileExtensionInRequire:
|
389
356
|
Enabled: true
|
390
357
|
|
391
|
-
Style/
|
392
|
-
Enabled:
|
358
|
+
Style/RedundantInterpolation:
|
359
|
+
Enabled: false
|
393
360
|
|
394
|
-
|
361
|
+
Style/RedundantParentheses:
|
395
362
|
Enabled: true
|
396
363
|
|
397
|
-
|
364
|
+
Style/RedundantRegexpCharacterClass:
|
398
365
|
Enabled: true
|
399
366
|
|
400
|
-
|
367
|
+
Style/RedundantRegexpEscape:
|
401
368
|
Enabled: true
|
402
369
|
|
403
|
-
|
370
|
+
Style/RedundantReturn:
|
404
371
|
Enabled: true
|
372
|
+
Severity: warning
|
405
373
|
|
406
|
-
Style/
|
374
|
+
Style/RedundantSelfAssignment:
|
407
375
|
Enabled: true
|
408
376
|
|
409
|
-
Style/
|
410
|
-
Enabled: false
|
411
|
-
|
412
|
-
Style/SwapValues:
|
377
|
+
Style/SelfAssignment:
|
413
378
|
Enabled: true
|
414
379
|
|
415
|
-
|
416
|
-
|
417
|
-
- spec/**/*
|
418
|
-
|
419
|
-
Layout/FirstHashElementIndentation:
|
420
|
-
EnforcedStyle: consistent
|
421
|
-
|
422
|
-
Style/FormatString:
|
423
|
-
Enabled: false
|
424
|
-
|
425
|
-
Style/FormatStringToken:
|
426
|
-
Enabled: false
|
380
|
+
Style/SingleArgumentDig:
|
381
|
+
Enabled: true
|
427
382
|
|
428
|
-
Style/
|
383
|
+
Style/SlicingWithRange:
|
429
384
|
Enabled: false
|
430
385
|
|
431
|
-
|
386
|
+
Style/SoleNestedConditional:
|
432
387
|
Enabled: true
|
433
388
|
|
434
|
-
Style/
|
389
|
+
Style/SpecialGlobalVars:
|
435
390
|
Enabled: true
|
391
|
+
Severity: warning
|
436
392
|
|
437
|
-
Style/
|
393
|
+
Style/StringConcatenation:
|
438
394
|
Enabled: true
|
439
395
|
|
440
|
-
|
441
|
-
Enabled:
|
396
|
+
Style/StringLiterals:
|
397
|
+
Enabled: false
|
442
398
|
|
443
|
-
|
444
|
-
Enabled: true
|
445
|
-
|
446
|
-
Style/NilLambda:
|
399
|
+
Style/SwapValues:
|
447
400
|
Enabled: true
|
448
401
|
|
449
|
-
|
402
|
+
Style/SymbolArray:
|
403
|
+
EnforcedStyle: brackets
|
404
|
+
|
405
|
+
Style/UnlessElse:
|
450
406
|
Enabled: true
|
451
407
|
|
452
|
-
Style/
|
408
|
+
Style/WordArray:
|
409
|
+
EnforcedStyle: brackets
|
410
|
+
|
411
|
+
Style/ZeroLengthPredicate:
|
453
412
|
Enabled: true
|
data/.simplycop_rails.yml
CHANGED
@@ -1,64 +1,20 @@
|
|
1
1
|
require:
|
2
2
|
- rubocop-rails
|
3
3
|
|
4
|
-
|
5
|
-
Exclude:
|
6
|
-
- 'db/schema.rb'
|
7
|
-
- 'vendor/**/*'
|
8
|
-
|
9
|
-
# Cop names are not displayed in offense messages by default. Change behavior
|
10
|
-
# by overriding DisplayCopNames, or by giving the -D/--display-cop-names
|
11
|
-
# option.
|
12
|
-
DisplayCopNames: true
|
13
|
-
# Style guide URLs are not displayed in offense messages by default. Change
|
14
|
-
# behavior by overriding DisplayStyleGuide, or by giving the
|
15
|
-
# -S/--display-style-guide option.
|
16
|
-
DisplayStyleGuide: true
|
17
|
-
UseCache: true
|
18
|
-
MaxFilesInCache: 5000
|
19
|
-
# Adapted from: https://github.com/simplybusiness/how-we-roll/blob/master/development/RUBYSTYLEGUIDE.markdown
|
20
|
-
|
21
|
-
Rails:
|
22
|
-
Enabled: true
|
23
|
-
|
24
|
-
## Rails Cops
|
25
|
-
Rails/TimeZone:
|
26
|
-
Enabled: true
|
27
|
-
Severity: warning
|
28
|
-
|
29
|
-
Rails/Date:
|
30
|
-
Enabled: true
|
31
|
-
Severity: warning
|
32
|
-
|
33
|
-
Rails/Delegate:
|
34
|
-
Enabled: false
|
35
|
-
|
36
|
-
Rails/Output:
|
37
|
-
Enabled: true
|
38
|
-
|
39
|
-
Rails/Validation:
|
40
|
-
Enabled: true
|
41
|
-
|
42
|
-
Rails/FindBy:
|
43
|
-
Enabled: true
|
44
|
-
|
45
|
-
Rails/ActionFilter:
|
46
|
-
Enabled: true
|
47
|
-
|
48
|
-
Rails/ReadWriteAttribute:
|
4
|
+
Rails/ActiveRecordCallbacksOrder:
|
49
5
|
Enabled: true
|
50
6
|
|
51
|
-
Rails/
|
7
|
+
Rails/AfterCommitOverride:
|
52
8
|
Enabled: true
|
53
9
|
|
54
|
-
Rails/
|
10
|
+
Rails/AttributeDefaultBlockValue:
|
55
11
|
Enabled: true
|
56
12
|
|
57
|
-
Rails/
|
13
|
+
Rails/DefaultScope:
|
58
14
|
Enabled: true
|
59
15
|
|
60
|
-
Rails/
|
61
|
-
Enabled:
|
16
|
+
Rails/Delegate:
|
17
|
+
Enabled: false
|
62
18
|
|
63
19
|
Rails/FindById:
|
64
20
|
Enabled: true
|
@@ -75,9 +31,11 @@ Rails/MatchRoute:
|
|
75
31
|
Rails/NegateInclude:
|
76
32
|
Enabled: true
|
77
33
|
|
34
|
+
# Conflicts with Mongoid
|
78
35
|
Rails/Pluck:
|
79
36
|
Enabled: false
|
80
37
|
|
38
|
+
# Conflicts with Mongoid
|
81
39
|
Rails/PluckInWhere:
|
82
40
|
Enabled: false
|
83
41
|
|
@@ -93,17 +51,13 @@ Rails/ShortI18n:
|
|
93
51
|
Rails/SquishedSQLHeredocs:
|
94
52
|
Enabled: true
|
95
53
|
|
54
|
+
Rails/WhereEquals:
|
55
|
+
Enabled: true
|
56
|
+
|
57
|
+
# Conflicts with Mongoid
|
96
58
|
Rails/WhereExists:
|
97
59
|
Enabled: false
|
98
60
|
|
61
|
+
# Conflicts with Mongoid
|
99
62
|
Rails/WhereNot:
|
100
63
|
Enabled: false
|
101
|
-
|
102
|
-
Rails/WhereEquals:
|
103
|
-
Enabled: true
|
104
|
-
|
105
|
-
Rails/AttributeDefaultBlockValue:
|
106
|
-
Enabled: true
|
107
|
-
|
108
|
-
Rails/ArelStar:
|
109
|
-
Enabled: true
|
data/.simplycop_rspec.yml
CHANGED
@@ -1,234 +1,48 @@
|
|
1
1
|
require:
|
2
2
|
- rubocop-rspec
|
3
3
|
|
4
|
-
RSpec/ContextMethod:
|
5
|
-
Enabled: false
|
6
|
-
|
7
|
-
RSpec/LeakyConstantDeclaration:
|
8
|
-
Enabled: false
|
9
|
-
|
10
|
-
RSpec/EmptyLineAfterExample:
|
11
|
-
Enabled: false
|
12
|
-
|
13
|
-
RSpec/AnyInstance:
|
14
|
-
Description: Check that instances are not being stubbed globally.
|
15
|
-
Enabled: true
|
16
|
-
|
17
|
-
RSpec/AroundBlock:
|
18
|
-
Description: Checks that around blocks actually run the test.
|
19
|
-
Enabled: true
|
20
|
-
|
21
|
-
RSpec/BeEql:
|
22
|
-
Description: Check for expectations where `be(...)` can replace `eql(...)`.
|
23
|
-
Enabled: true
|
24
|
-
|
25
4
|
RSpec/BeforeAfterAll:
|
26
|
-
Description: Check that before/after(:all) isn't being used.
|
27
5
|
Enabled: false
|
28
6
|
|
29
7
|
RSpec/DescribeClass:
|
30
|
-
Description: Check that the first argument to the top level describe is a constant.
|
31
|
-
Enabled: false
|
32
|
-
|
33
|
-
RSpec/DescribedClass:
|
34
|
-
Description: Checks that tests use `described_class`.
|
35
|
-
SkipBlocks: false
|
36
8
|
Enabled: false
|
37
|
-
EnforcedStyle: described_class
|
38
|
-
SupportedStyles:
|
39
|
-
- described_class
|
40
|
-
- explicit
|
41
9
|
|
42
10
|
RSpec/DescribeMethod:
|
43
|
-
Description: Checks that the second argument to `describe` specifies a method.
|
44
|
-
Enabled: false
|
45
|
-
|
46
|
-
RSpec/DescribeSymbol:
|
47
|
-
Description: Avoid describing symbols.
|
48
11
|
Enabled: false
|
49
12
|
|
50
|
-
RSpec/
|
51
|
-
Description: Check that `all` matcher is used instead of iterating over an array.
|
52
|
-
Enabled: true
|
53
|
-
|
54
|
-
RSpec/EmptyExampleGroup:
|
55
|
-
Description: Checks if an example group does not include any tests.
|
56
|
-
Enabled: true
|
57
|
-
|
58
|
-
RSpec/EmptyLineAfterFinalLet:
|
59
|
-
Description: Checks if there is an empty line after the last let block.
|
60
|
-
Enabled: false
|
61
|
-
|
62
|
-
RSpec/EmptyLineAfterSubject:
|
63
|
-
Description: Checks if there is an empty line after subject block.
|
13
|
+
RSpec/DescribedClass:
|
64
14
|
Enabled: false
|
65
15
|
|
66
16
|
RSpec/ExampleLength:
|
67
|
-
Description: Checks for long examples.
|
68
17
|
Enabled: false
|
69
|
-
Max: 5
|
70
|
-
|
71
|
-
RSpec/ExampleWording:
|
72
|
-
Description: Checks for common mistakes in example descriptions.
|
73
|
-
Enabled: true
|
74
|
-
CustomTransform:
|
75
|
-
be: is
|
76
|
-
BE: IS
|
77
|
-
have: has
|
78
|
-
HAVE: HAS
|
79
|
-
IgnoredWords: []
|
80
|
-
|
81
|
-
RSpec/ExpectActual:
|
82
|
-
Description: Checks for `expect(...)` calls containing literal values.
|
83
|
-
Enabled: true
|
84
18
|
|
85
19
|
RSpec/ExpectOutput:
|
86
|
-
Description: Checks for opportunities to use `expect { ... }.to output`.
|
87
20
|
Enabled: false
|
88
21
|
|
89
22
|
RSpec/FilePath:
|
90
|
-
Description: Checks that spec file paths are consistent with the test subject.
|
91
|
-
Enabled: false
|
92
|
-
CustomTransform:
|
93
|
-
RuboCop: rubocop
|
94
|
-
RSpec: rspec
|
95
|
-
IgnoreMethods: false
|
96
|
-
|
97
|
-
RSpec/Focus:
|
98
|
-
Description: Checks if examples are focused.
|
99
|
-
Enabled: false
|
100
|
-
|
101
|
-
RSpec/HookArgument:
|
102
|
-
Description: Checks the arguments passed to `before`, `around`, and `after`.
|
103
|
-
Enabled: true
|
104
|
-
EnforcedStyle: implicit
|
105
|
-
SupportedStyles:
|
106
|
-
- implicit
|
107
|
-
- each
|
108
|
-
- example
|
109
|
-
|
110
|
-
RSpec/ImplicitExpect:
|
111
|
-
Description: Check that a consistent implicit expectation style is used.
|
112
|
-
Enabled: true
|
113
|
-
EnforcedStyle: is_expected
|
114
|
-
SupportedStyles:
|
115
|
-
- is_expected
|
116
|
-
- should
|
117
|
-
|
118
|
-
RSpec/InstanceSpy:
|
119
|
-
Description: Checks for `instance_double` used with `have_received`.
|
120
23
|
Enabled: false
|
121
24
|
|
122
25
|
RSpec/InstanceVariable:
|
123
|
-
Description: Checks for instance variable usage in specs.
|
124
|
-
AssignmentOnly: false
|
125
26
|
Enabled: false
|
126
27
|
|
127
|
-
RSpec/ItBehavesLike:
|
128
|
-
Description: Checks that only one `it_behaves_like` style is used.
|
129
|
-
Enabled: true
|
130
|
-
EnforcedStyle: it_behaves_like
|
131
|
-
SupportedStyles:
|
132
|
-
- it_behaves_like
|
133
|
-
- it_should_behave_like
|
134
|
-
|
135
|
-
RSpec/LeadingSubject:
|
136
|
-
Description: Checks for `subject` definitions that come after `let` definitions.
|
137
|
-
Enabled: true
|
138
|
-
|
139
|
-
RSpec/LetSetup:
|
140
|
-
Description: Checks unreferenced `let!` calls being used for test setup.
|
141
|
-
Enabled: true
|
142
|
-
|
143
|
-
RSpec/MessageChain:
|
144
|
-
Description: Check that chains of messages are not being stubbed.
|
145
|
-
Enabled: true
|
146
|
-
|
147
|
-
RSpec/MessageExpectation:
|
148
|
-
Description: Checks for consistent message expectation style.
|
149
|
-
Enabled: false
|
150
|
-
EnforcedStyle: allow
|
151
|
-
SupportedStyles:
|
152
|
-
- allow
|
153
|
-
- expect
|
154
|
-
|
155
28
|
RSpec/MessageSpies:
|
156
|
-
Description: Checks that message expectations are set using spies.
|
157
29
|
Enabled: false
|
158
|
-
EnforcedStyle: have_received
|
159
|
-
SupportedStyles:
|
160
|
-
- have_received
|
161
|
-
- receive
|
162
|
-
|
163
|
-
RSpec/MultipleDescribes:
|
164
|
-
Description: Checks for multiple top level describes.
|
165
|
-
Enabled: true
|
166
30
|
|
167
31
|
RSpec/MultipleExpectations:
|
168
|
-
Description: Checks if examples contain too many `expect` calls.
|
169
32
|
Enabled: false
|
170
|
-
Max: 1
|
171
33
|
|
172
34
|
RSpec/MultipleMemoizedHelpers:
|
173
35
|
Enabled: false
|
174
36
|
|
175
|
-
RSpec/NamedSubject:
|
176
|
-
Description: Checks for explicitly referenced test subjects.
|
177
|
-
Enabled: true
|
178
|
-
|
179
37
|
RSpec/NestedGroups:
|
180
|
-
Description: Checks for nested example groups.
|
181
38
|
Enabled: true
|
182
39
|
Max: 4
|
183
40
|
|
184
41
|
RSpec/NotToNot:
|
185
|
-
Description: Checks for consistent method usage for negating expectations.
|
186
|
-
EnforcedStyle: not_to
|
187
|
-
SupportedStyles:
|
188
|
-
- not_to
|
189
|
-
- to_not
|
190
42
|
Enabled: false
|
191
43
|
|
192
|
-
RSpec/OverwritingSetup:
|
193
|
-
Enabled: true
|
194
|
-
Description: Checks if there is a let/subject that overwrites an existing one.
|
195
|
-
|
196
|
-
RSpec/RepeatedDescription:
|
197
|
-
Enabled: true
|
198
|
-
Description: Check for repeated description strings in example groups.
|
199
|
-
|
200
|
-
RSpec/RepeatedExample:
|
201
|
-
Enabled: true
|
202
|
-
Description: Check for repeated examples within example groups.
|
203
|
-
|
204
|
-
RSpec/SharedContext:
|
205
|
-
Description: Checks for proper shared_context and shared_examples usage.
|
206
|
-
Enabled: true
|
207
|
-
|
208
|
-
RSpec/SingleArgumentMessageChain:
|
209
|
-
Description: Checks that chains of messages contain more than one element.
|
210
|
-
Enabled: true
|
211
|
-
|
212
|
-
RSpec/ScatteredLet:
|
213
|
-
Description: Checks for let scattered across the example group.
|
214
|
-
Enabled: true
|
215
|
-
|
216
44
|
RSpec/ScatteredSetup:
|
217
|
-
Description: Checks for setup scattered across multiple hooks in an example group.
|
218
|
-
Enabled: false
|
219
|
-
|
220
|
-
RSpec/SubjectStub:
|
221
|
-
Description: Checks for stubbed test subjects.
|
222
|
-
Enabled: true
|
223
|
-
|
224
|
-
RSpec/VerifiedDoubles:
|
225
|
-
Description: Prefer using verifying doubles over normal doubles.
|
226
45
|
Enabled: false
|
227
|
-
IgnoreSymbolicNames: true
|
228
|
-
|
229
|
-
Metrics/BlockLength:
|
230
|
-
Exclude:
|
231
|
-
- 'spec/**/*.rb'
|
232
46
|
|
233
47
|
RSpec/StubbedMock:
|
234
48
|
Enabled: false
|
data/.simplycop_security.yml
CHANGED
@@ -0,0 +1,36 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module CustomCops
|
4
|
+
class DontPrintAllEnv < RuboCop::Cop::Cop
|
5
|
+
# This cop checks if someone accidentally print all environment variables
|
6
|
+
# because some of them may contain secrets.
|
7
|
+
#
|
8
|
+
# @example
|
9
|
+
# # bad
|
10
|
+
# puts ENV.to_h
|
11
|
+
# puts `env`
|
12
|
+
# puts ENVIRON.to_h
|
13
|
+
#
|
14
|
+
# # good
|
15
|
+
# puts ENV['SOME_KEY']
|
16
|
+
# puts ENVIRON['SOME_KEY']
|
17
|
+
MSG = 'Printing all Environment Variables is extremely risky'\
|
18
|
+
' If this code has been run, then it is likely that secrets have been'\
|
19
|
+
' exposed in plaintext. Please alert `#infosec` about this so it can be'\
|
20
|
+
' investigated immediately.'\
|
21
|
+
|
22
|
+
def_node_matcher :convert_env_to_hash_or_array?, <<~PATTERN
|
23
|
+
(send (const nil? {:ENVIRON :ENV}) {:to_h :to_a :to_hash})
|
24
|
+
PATTERN
|
25
|
+
|
26
|
+
def_node_matcher :print_all_env_shell?, <<~PATTERN
|
27
|
+
(send nil? {:puts :p :print} (xstr(str "env")))
|
28
|
+
PATTERN
|
29
|
+
|
30
|
+
def on_send(node)
|
31
|
+
return unless convert_env_to_hash_or_array?(node) || print_all_env_shell?(node)
|
32
|
+
|
33
|
+
add_offense(node, location: :selector)
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
data/lib/simplycop/version.rb
CHANGED
data/simplycop.gemspec
CHANGED
@@ -17,9 +17,9 @@ Gem::Specification.new do |spec|
|
|
17
17
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
18
18
|
spec.require_paths = ['lib']
|
19
19
|
|
20
|
-
spec.add_dependency 'rubocop', '~> 1.
|
20
|
+
spec.add_dependency 'rubocop', '~> 1.8.1'
|
21
21
|
spec.add_dependency 'rubocop-rails', '~> 2.9.0'
|
22
|
-
spec.add_dependency 'rubocop-rspec', '~> 2.0
|
22
|
+
spec.add_dependency 'rubocop-rspec', '~> 2.1.0'
|
23
23
|
spec.add_development_dependency 'bundler'
|
24
24
|
spec.add_development_dependency 'rake', '>= 12.3.3'
|
25
25
|
spec.add_development_dependency 'rspec', '~> 3.10'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simplycop
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Simply Business
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-01-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubocop
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.
|
19
|
+
version: 1.8.1
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 1.
|
26
|
+
version: 1.8.1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rubocop-rails
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 2.0
|
47
|
+
version: 2.1.0
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 2.0
|
54
|
+
version: 2.1.0
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: bundler
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -103,6 +103,7 @@ extensions: []
|
|
103
103
|
extra_rdoc_files: []
|
104
104
|
files:
|
105
105
|
- ".custom_simplycop.yml"
|
106
|
+
- ".github/dependabot.yml"
|
106
107
|
- ".github/workflows/ci.yml"
|
107
108
|
- ".github/workflows/publish_gem.yml"
|
108
109
|
- ".github/workflows/version_forget_me_not.yml"
|
@@ -124,6 +125,7 @@ files:
|
|
124
125
|
- lib/simplycop.rb
|
125
126
|
- lib/simplycop/custom_cops/constantize.rb
|
126
127
|
- lib/simplycop/custom_cops/define_method.rb
|
128
|
+
- lib/simplycop/custom_cops/dont_print_all_env.rb
|
127
129
|
- lib/simplycop/custom_cops/instance_eval.rb
|
128
130
|
- lib/simplycop/custom_cops/method_missing.rb
|
129
131
|
- lib/simplycop/custom_cops/timecop_without_block.rb
|
@@ -152,7 +154,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
152
154
|
- !ruby/object:Gem::Version
|
153
155
|
version: '0'
|
154
156
|
requirements: []
|
155
|
-
rubygems_version: 3.
|
157
|
+
rubygems_version: 3.2.3
|
156
158
|
signing_key:
|
157
159
|
specification_version: 4
|
158
160
|
summary: Provides a single point of reference for common rubocop rules.
|