puppetlabs_spec_helper 2.8.0 → 2.9.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 560988fc4b9b6843571dd84cb9950ed4e7183b13
4
- data.tar.gz: c0a9ecd1c637521bcbb2376e0db81805ed9c908c
2
+ SHA256:
3
+ metadata.gz: 6821247effca57cc705aad0fd004ab5fda488ed7053734c996b1ee3249cea435
4
+ data.tar.gz: 7b762f7e6e5ab7986574e4d080c070a1ee010dfa56baeccb3a6e13c70b4cdee8
5
5
  SHA512:
6
- metadata.gz: 12dd845bdcfafb01e7e81d6c4d603abc1b235d175711883cdc0e73fd59cb53f6901bfe45e9b52d65333e704f7bf47a29e4d729a881f4eb91ddd5115d7739f081
7
- data.tar.gz: 23fa34f17299df694322d9f8402fa95e4f39d7b7eb10c513022431145f709e64167fb190287afd39f96f744dd67529c24db7afe3cd4fc5a4cf294ea0f6c3fe55
6
+ metadata.gz: 98520f9b6d4b1d7c3f4209991c6c11188b7637dea387de6322f6a2201e8af9203fbc20ab0e777c2cb19f38f05a2c106fd82f8827756a16463ef17c09b8ba8f9d
7
+ data.tar.gz: cc4718fd5b4424b55980117271b88bdeaf778d3a1c87b34a83d9d79425cde795bf4315c4a11fe05e672ac8f980b74fcc723d9ce238a8982b29c7eaa9d07a4a03
data/.rspec CHANGED
@@ -1,2 +1,3 @@
1
1
  --format documentation
2
2
  --color
3
+ --order rand
data/.rubocop.yml CHANGED
@@ -1,504 +1,138 @@
1
1
  require: rubocop-rspec
2
+ inherit_from: .rubocop_todo.yml
3
+
2
4
  AllCops:
3
5
  TargetRubyVersion: 1.9
4
- Include:
5
- - ./**/*.rb
6
-
7
- Lint/ConditionPosition:
8
- Enabled: True
9
-
10
- Lint/ElseLayout:
11
- Enabled: True
12
-
13
- Lint/UnreachableCode:
14
- Enabled: True
15
-
16
- Lint/UselessComparison:
17
- Enabled: True
18
-
19
- Lint/EnsureReturn:
20
- Enabled: True
21
-
22
- Lint/HandleExceptions:
23
- Enabled: True
24
-
25
- Lint/LiteralInCondition:
26
- Enabled: True
27
-
28
- Lint/ShadowingOuterLocalVariable:
29
- Enabled: True
30
-
31
- Lint/LiteralInInterpolation:
32
- Enabled: True
33
-
34
- Style/HashSyntax:
35
- Enabled: True
36
-
37
- Style/RedundantReturn:
38
- Enabled: True
39
-
40
- Lint/AmbiguousOperator:
41
- Enabled: True
42
-
43
- Lint/AssignmentInCondition:
44
- Enabled: True
45
-
46
- Style/SpaceBeforeComment:
47
- Enabled: True
48
-
49
- Style/AndOr:
50
- Enabled: True
51
-
52
- Style/RedundantSelf:
53
- Enabled: True
54
-
55
- # Method length is not necessarily an indicator of code quality
56
- Metrics/MethodLength:
6
+ Exclude:
7
+ # binstubs, and other utilities
8
+ - bin/**/*
9
+ - vendor/**/*
10
+ - vendor/**/.*
11
+ # Puppet util code follows Puppet's style, not pdk's
12
+ - lib/puppet/**/*
13
+ # package testing gems
14
+ - package-testing/vendor/**/*
15
+ - package-testing/vendor/**/.*
16
+
17
+ Layout/IndentHeredoc:
18
+ Description: The `squiggly` style would be preferable, but is only available from ruby 2.3. We'll enable this when we can.
57
19
  Enabled: False
58
20
 
59
- # Module length is not necessarily an indicator of code quality
60
- Metrics/ModuleLength:
21
+ # Metrics, excludes complexity and sizing metrics for now, as ruby's defaults are very strict
22
+ Metrics/AbcSize:
61
23
  Enabled: False
62
24
 
63
- Style/WhileUntilModifier:
64
- Enabled: True
65
-
66
- Lint/AmbiguousRegexpLiteral:
67
- Enabled: True
68
-
69
- Lint/Eval:
70
- Enabled: True
71
-
72
- Lint/BlockAlignment:
73
- Enabled: True
74
-
75
- Lint/DefEndAlignment:
76
- Enabled: True
77
-
78
- Lint/EndAlignment:
79
- Enabled: True
80
-
81
- Lint/DeprecatedClassMethods:
82
- Enabled: True
83
-
84
- Lint/Loop:
85
- Enabled: True
86
-
87
- Lint/ParenthesesAsGroupedExpression:
88
- Enabled: True
89
-
90
- Lint/RescueException:
91
- Enabled: True
92
-
93
- Lint/StringConversionInInterpolation:
94
- Enabled: True
95
-
96
- Lint/UnusedBlockArgument:
97
- Enabled: True
98
-
99
- Lint/UnusedMethodArgument:
100
- Enabled: True
101
-
102
- Lint/UselessAccessModifier:
103
- Enabled: True
104
-
105
- Lint/UselessAssignment:
106
- Enabled: True
107
-
108
- Lint/Void:
109
- Enabled: True
110
-
111
- Style/AccessModifierIndentation:
112
- Enabled: True
113
-
114
- Style/AccessorMethodName:
115
- Enabled: True
116
-
117
- Style/Alias:
118
- Enabled: True
119
-
120
- Style/AlignArray:
121
- Enabled: True
122
-
123
- Style/AlignHash:
124
- Enabled: True
125
-
126
- Style/AlignParameters:
127
- Enabled: True
128
-
129
- Metrics/BlockNesting:
130
- Enabled: True
131
-
132
- Style/AsciiComments:
133
- Enabled: True
134
-
135
- Style/Attr:
136
- Enabled: True
137
-
138
- Style/BracesAroundHashParameters:
139
- Enabled: True
140
-
141
- Style/CaseEquality:
142
- Enabled: True
143
-
144
- Style/CaseIndentation:
145
- Enabled: True
146
-
147
- Style/CharacterLiteral:
148
- Enabled: True
149
-
150
- Style/ClassAndModuleCamelCase:
151
- Enabled: True
152
-
153
- Style/ClassAndModuleChildren:
25
+ Metrics/BlockLength:
26
+ Description: rspec uses long describe blocks, so allow long blocks under spec/
154
27
  Enabled: False
28
+ Exclude:
29
+ - 'spec/**/*.rb'
155
30
 
156
- Style/ClassCheck:
157
- Enabled: True
158
-
159
- # Class length is not necessarily an indicator of code quality
160
31
  Metrics/ClassLength:
161
32
  Enabled: False
162
33
 
163
- Style/ClassMethods:
164
- Enabled: True
165
-
166
- Style/ClassVars:
167
- Enabled: True
168
-
169
- Style/WhenThen:
170
- Enabled: True
171
-
172
- Style/WordArray:
173
- Enabled: True
174
-
175
- Style/UnneededPercentQ:
176
- Enabled: True
177
-
178
- Style/Tab:
179
- Enabled: True
180
-
181
- Style/SpaceBeforeSemicolon:
182
- Enabled: True
183
-
184
- Style/TrailingBlankLines:
185
- Enabled: True
186
-
187
- Style/SpaceInsideBlockBraces:
188
- Enabled: True
189
-
190
- Style/SpaceInsideBrackets:
191
- Enabled: True
192
-
193
- Style/SpaceInsideHashLiteralBraces:
194
- Enabled: True
195
-
196
- Style/SpaceInsideParens:
197
- Enabled: True
198
-
199
- Style/LeadingCommentSpace:
200
- Enabled: True
201
-
202
- Style/SpaceBeforeFirstArg:
203
- Enabled: True
204
-
205
- Style/SpaceAfterColon:
206
- Enabled: True
207
-
208
- Style/SpaceAfterComma:
209
- Enabled: True
210
-
211
- Style/SpaceAfterMethodName:
212
- Enabled: True
213
-
214
- Style/SpaceAfterNot:
215
- Enabled: True
216
-
217
- Style/SpaceAfterSemicolon:
218
- Enabled: True
219
-
220
- Style/SpaceAroundEqualsInParameterDefault:
221
- Enabled: True
222
-
223
- Style/SpaceAroundOperators:
224
- Enabled: True
225
-
226
- Style/SpaceBeforeBlockBraces:
227
- Enabled: True
228
-
229
- Style/SpaceBeforeComma:
230
- Enabled: True
231
-
232
- Style/CollectionMethods:
233
- Enabled: True
234
-
235
- Style/CommentIndentation:
236
- Enabled: True
237
-
238
- Style/ColonMethodCall:
239
- Enabled: True
240
-
241
- Style/CommentAnnotation:
242
- Enabled: True
243
-
244
- # 'Complexity' is very relative
245
34
  Metrics/CyclomaticComplexity:
246
35
  Enabled: False
247
36
 
248
- Style/ConstantName:
249
- Enabled: True
37
+ Metrics/LineLength:
38
+ Description: People have wide screens, use them.
39
+ Max: 200
250
40
 
251
- Style/Documentation:
41
+ Metrics/MethodLength:
252
42
  Enabled: False
253
43
 
254
- Style/DefWithParentheses:
255
- Enabled: True
256
-
257
- Style/PreferredHashMethods:
258
- Enabled: True
259
-
260
- Style/DotPosition:
261
- EnforcedStyle: trailing
262
-
263
- Style/DoubleNegation:
264
- Enabled: True
265
-
266
- Style/EachWithObject:
267
- Enabled: True
268
-
269
- Style/EmptyLineBetweenDefs:
270
- Enabled: True
271
-
272
- Style/IndentArray:
273
- Enabled: True
44
+ Metrics/ModuleLength:
45
+ Enabled: False
274
46
 
275
- Style/IndentHash:
276
- Enabled: True
47
+ Metrics/ParameterLists:
48
+ Enabled: False
277
49
 
278
- Style/IndentationConsistency:
279
- Enabled: True
50
+ Metrics/PerceivedComplexity:
51
+ Enabled: False
280
52
 
281
- Style/IndentationWidth:
282
- Enabled: True
53
+ # RSpec cops
54
+ RSpec/BeforeAfterAll:
55
+ Description: Beware of using after(:all) as it may cause state to leak between tests. A necessary evil in acceptance testing.
56
+ Exclude:
57
+ - 'spec/acceptance/**/*.rb'
58
+ - 'package-testing/spec/package/**/*.rb'
283
59
 
284
- Style/EmptyLines:
285
- Enabled: True
60
+ RSpec/DescribeClass:
61
+ Description: This cop does not account for rspec-puppet, and beaker-rspec usage.
62
+ Enabled: False
286
63
 
287
- Style/EmptyLinesAroundAccessModifier:
288
- Enabled: True
64
+ RSpec/HookArgument:
65
+ Description: Prefer explicit :each argument, matching existing module's style
66
+ EnforcedStyle: each
289
67
 
290
- Style/EmptyLiteral:
291
- Enabled: True
68
+ RSpec/NestedGroups:
69
+ Description: Nested groups can lead to cleaner tests with less duplication
70
+ Max: 10
292
71
 
293
- # Configuration parameters: AllowURI, URISchemes.
294
- Metrics/LineLength:
72
+ RSpec/ExampleLength:
73
+ Description: Forcing short examples leads to the creation of one-time use let() helpers
295
74
  Enabled: False
296
75
 
297
- Style/MethodCallParentheses:
298
- Enabled: True
299
-
300
- Style/MethodDefParentheses:
301
- Enabled: True
302
-
303
- Style/LineEndConcatenation:
304
- Enabled: True
76
+ RSpec/MessageSpies:
77
+ EnforcedStyle: receive
305
78
 
306
- Style/TrailingWhitespace:
307
- Enabled: True
79
+ # Style Cops
80
+ Style/AsciiComments:
81
+ Description: Names, non-english speaking communities.
82
+ Enabled: False
308
83
 
309
- Style/StringLiterals:
310
- Enabled: True
84
+ Style/BlockDelimiters:
85
+ Description: Prefer braces for chaining. Mostly an aesthetical choice. Better to be consistent then.
86
+ EnforcedStyle: braces_for_chaining
311
87
 
312
- Style/TrailingCommaInArguments:
313
- Enabled: True
88
+ Style/ClassAndModuleChildren:
89
+ Description: Compact style reduces the required amount of indentation.
90
+ EnforcedStyle: compact
314
91
 
315
- Style/TrailingCommaInLiteral:
316
- Enabled: True
92
+ Style/EmptyElse:
93
+ Description: Enforce against empty else clauses, but allow `nil` for clarity.
94
+ EnforcedStyle: empty
317
95
 
318
- Style/GlobalVars:
319
- Enabled: True
96
+ Style/FormatString:
97
+ Description: Following the main puppet project's style, prefer the % format format.
98
+ EnforcedStyle: percent
320
99
 
321
- Style/GuardClause:
322
- Enabled: True
100
+ Style/FormatStringToken:
101
+ Description: Following the main puppet project's style, prefer the simpler template tokens over annotated ones.
102
+ EnforcedStyle: template
323
103
 
324
104
  Style/IfUnlessModifier:
325
- Enabled: True
326
-
327
- Style/MultilineIfThen:
328
- Enabled: True
329
-
330
- Style/NegatedIf:
331
- Enabled: True
332
-
333
- Style/NegatedWhile:
334
- Enabled: True
335
-
336
- Style/Next:
337
- Enabled: True
338
-
339
- Style/SingleLineBlockParams:
340
- Enabled: True
341
-
342
- Style/SingleLineMethods:
343
- Enabled: True
344
-
345
- Style/SpecialGlobalVars:
346
- Enabled: True
347
-
348
- Style/TrivialAccessors:
349
- Enabled: True
350
-
351
- Style/UnlessElse:
352
- Enabled: True
353
-
354
- Style/VariableInterpolation:
355
- Enabled: True
356
-
357
- Style/VariableName:
358
- Enabled: True
359
-
360
- Style/WhileUntilDo:
361
- Enabled: True
362
-
363
- Style/EvenOdd:
364
- Enabled: True
365
-
366
- Style/FileName:
367
- Enabled: True
368
-
369
- Style/For:
370
- Enabled: True
105
+ Description: Post-fix `if` modifiers are hard to parse for newcomers. We don't want to encourage them. Post-fix `unless` modifiers could be nice in some cases, but the Cop doesn't differentiate.
106
+ Enabled: false
371
107
 
372
108
  Style/Lambda:
373
- Enabled: True
374
-
375
- Style/MethodName:
376
- Enabled: True
377
-
378
- Style/MultilineTernaryOperator:
379
- Enabled: True
380
-
381
- Style/NestedTernaryOperator:
382
- Enabled: True
383
-
384
- Style/NilComparison:
385
- Enabled: True
386
-
387
- Style/FormatString:
388
- Enabled: True
389
-
390
- Style/MultilineBlockChain:
391
- Enabled: True
392
-
393
- Style/Semicolon:
394
- Enabled: True
109
+ Description: Prefer the keyword for easier discoverability.
110
+ EnforcedStyle: literal
395
111
 
396
- Style/SignalException:
397
- Enabled: True
112
+ Style/MethodCalledOnDoEndBlock:
113
+ Enabled: true
398
114
 
399
- Style/NonNilCheck:
400
- Enabled: True
401
-
402
- Style/Not:
403
- Enabled: True
404
-
405
- Style/NumericLiterals:
406
- Enabled: True
407
-
408
- Style/OneLineConditional:
409
- Enabled: True
410
-
411
- Style/OpMethod:
412
- Enabled: True
413
-
414
- Style/ParenthesesAroundCondition:
415
- Enabled: True
416
-
417
- Style/PercentLiteralDelimiters:
418
- Enabled: True
419
-
420
- Style/PerlBackrefs:
421
- Enabled: True
422
-
423
- Style/PredicateName:
424
- Enabled: True
425
-
426
- Style/RedundantException:
427
- Enabled: True
428
-
429
- Style/SelfAssignment:
430
- Enabled: True
431
-
432
- Style/Proc:
433
- Enabled: True
434
-
435
- Style/RaiseArgs:
436
- Enabled: True
437
-
438
- Style/RedundantBegin:
439
- Enabled: True
440
-
441
- Style/RescueModifier:
442
- Enabled: True
443
-
444
- # based on https://github.com/voxpupuli/modulesync_config/issues/168
445
115
  Style/RegexpLiteral:
116
+ Description: Community preference. See https://github.com/voxpupuli/modulesync_config/issues/168
446
117
  EnforcedStyle: percent_r
447
- Enabled: True
448
-
449
- Lint/UnderscorePrefixedVariableName:
450
- Enabled: True
451
-
452
- Metrics/ParameterLists:
453
- Enabled: False
454
-
455
- Lint/RequireParentheses:
456
- Enabled: True
457
-
458
- Style/SpaceBeforeFirstArg:
459
- Enabled: True
460
-
461
- Style/ModuleFunction:
462
- Enabled: True
463
118
 
464
- Lint/Debugger:
465
- Enabled: True
119
+ Style/SymbolProc:
120
+ Description: SymbolProc notation is not discoverable
121
+ Enabled: false
466
122
 
467
- Style/IfWithSemicolon:
468
- Enabled: True
123
+ Style/TernaryParentheses:
124
+ Description: Checks for use of parentheses around ternary conditions. Enforce parentheses on complex expressions for better readability, but seriously consider breaking it up.
125
+ EnforcedStyle: require_parentheses_when_complex
469
126
 
470
- Style/Encoding:
471
- Enabled: True
472
-
473
- Style/BlockDelimiters:
474
- Enabled: True
475
-
476
- Style/MultilineBlockLayout:
477
- Enabled: True
478
-
479
- # 'Complexity' is very relative
480
- Metrics/AbcSize:
481
- Enabled: False
482
-
483
- # 'Complexity' is very relative
484
- Metrics/PerceivedComplexity:
485
- Enabled: False
486
-
487
- Lint/UselessAssignment:
488
- Enabled: True
489
-
490
- Style/ClosingParenthesisIndentation:
491
- Enabled: False
492
-
493
- # RSpec
494
-
495
- # We don't use rspec in this way
496
- RSpec/DescribeClass:
497
- Enabled: False
127
+ Style/TrailingCommaInArguments:
128
+ Description: Prefer always trailing comma on multiline argument lists. This makes diffs, and re-ordering nicer.
129
+ EnforcedStyleForMultiline: comma
498
130
 
499
- # Example length is not necessarily an indicator of code quality
500
- RSpec/ExampleLength:
501
- Enabled: False
131
+ Style/TrailingCommaInLiteral:
132
+ Description: Prefer always trailing comma on multiline literals. This makes diffs, and re-ordering nicer.
133
+ EnforcedStyleForMultiline: comma
502
134
 
503
- RSpec/NamedSubject:
504
- Enabled: False
135
+ Style/SymbolArray:
136
+ Description: Using percent style obscures symbolic intent of array's contents.
137
+ Enabled: true
138
+ EnforcedStyle: brackets