puppet-lint 2.5.2 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (112) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +522 -0
  3. data/lib/puppet-lint/bin.rb +71 -6
  4. data/lib/puppet-lint/checkplugin.rb +43 -9
  5. data/lib/puppet-lint/checks.rb +16 -16
  6. data/lib/puppet-lint/configuration.rb +134 -134
  7. data/lib/puppet-lint/data.rb +28 -28
  8. data/lib/puppet-lint/lexer/string_slurper.rb +138 -140
  9. data/lib/puppet-lint/lexer/token.rb +188 -190
  10. data/lib/puppet-lint/lexer.rb +416 -417
  11. data/lib/puppet-lint/monkeypatches.rb +1 -1
  12. data/lib/puppet-lint/optparser.rb +5 -1
  13. data/lib/puppet-lint/plugins/check_classes/arrow_on_right_operand_line.rb +6 -4
  14. data/lib/puppet-lint/plugins/check_classes/autoloader_layout.rb +5 -3
  15. data/lib/puppet-lint/plugins/check_classes/class_inherits_from_params_class.rb +6 -4
  16. data/lib/puppet-lint/plugins/check_classes/code_on_top_scope.rb +5 -3
  17. data/lib/puppet-lint/plugins/check_classes/inherits_across_namespaces.rb +5 -3
  18. data/lib/puppet-lint/plugins/check_classes/names_containing_dash.rb +5 -3
  19. data/lib/puppet-lint/plugins/check_classes/names_containing_uppercase.rb +7 -5
  20. data/lib/puppet-lint/plugins/check_classes/nested_classes_or_defines.rb +5 -3
  21. data/lib/puppet-lint/plugins/check_classes/parameter_order.rb +7 -4
  22. data/lib/puppet-lint/plugins/check_classes/right_to_left_relationship.rb +5 -3
  23. data/lib/puppet-lint/plugins/check_classes/variable_scope.rb +15 -13
  24. data/lib/puppet-lint/plugins/check_comments/slash_comments.rb +9 -7
  25. data/lib/puppet-lint/plugins/check_comments/star_comments.rb +10 -8
  26. data/lib/puppet-lint/plugins/check_conditionals/case_without_default.rb +6 -4
  27. data/lib/puppet-lint/plugins/check_conditionals/selector_inside_resource.rb +5 -3
  28. data/lib/puppet-lint/plugins/check_documentation/documentation.rb +7 -3
  29. data/lib/puppet-lint/plugins/check_nodes/unquoted_node_name.rb +15 -11
  30. data/lib/puppet-lint/plugins/check_resources/duplicate_params.rb +5 -3
  31. data/lib/puppet-lint/plugins/check_resources/ensure_first_param.rb +8 -5
  32. data/lib/puppet-lint/plugins/check_resources/ensure_not_symlink_target.rb +11 -8
  33. data/lib/puppet-lint/plugins/check_resources/file_mode.rb +14 -9
  34. data/lib/puppet-lint/plugins/check_resources/unquoted_file_mode.rb +11 -6
  35. data/lib/puppet-lint/plugins/check_resources/unquoted_resource_title.rb +6 -4
  36. data/lib/puppet-lint/plugins/check_strings/double_quoted_strings.rb +12 -7
  37. data/lib/puppet-lint/plugins/check_strings/only_variable_string.rb +8 -6
  38. data/lib/puppet-lint/plugins/check_strings/puppet_url_without_modules.rb +14 -8
  39. data/lib/puppet-lint/plugins/check_strings/quoted_booleans.rb +11 -7
  40. data/lib/puppet-lint/plugins/check_strings/single_quote_string_with_variables.rb +11 -6
  41. data/lib/puppet-lint/plugins/check_strings/variables_not_enclosed.rb +12 -8
  42. data/lib/puppet-lint/plugins/check_variables/variable_contains_dash.rb +11 -7
  43. data/lib/puppet-lint/plugins/check_variables/variable_is_lowercase.rb +11 -7
  44. data/lib/puppet-lint/plugins/check_whitespace/140chars.rb +3 -8
  45. data/lib/puppet-lint/plugins/check_whitespace/2sp_soft_tabs.rb +10 -8
  46. data/lib/puppet-lint/plugins/check_whitespace/80chars.rb +3 -8
  47. data/lib/puppet-lint/plugins/check_whitespace/arrow_alignment.rb +10 -8
  48. data/lib/puppet-lint/plugins/check_whitespace/hard_tabs.rb +11 -7
  49. data/lib/puppet-lint/plugins/check_whitespace/line_length.rb +29 -0
  50. data/lib/puppet-lint/plugins/check_whitespace/trailing_whitespace.rb +13 -7
  51. data/lib/puppet-lint/plugins.rb +63 -61
  52. data/lib/puppet-lint/report/github.rb +17 -0
  53. data/lib/puppet-lint/report/sarif_template.json +63 -0
  54. data/lib/puppet-lint/tasks/puppet-lint.rb +84 -83
  55. data/lib/puppet-lint/tasks/release_test.rb +4 -1
  56. data/lib/puppet-lint/version.rb +1 -1
  57. data/lib/puppet-lint.rb +27 -12
  58. data/spec/acceptance/puppet_lint_spec.rb +46 -0
  59. data/spec/spec_helper.rb +92 -91
  60. data/spec/spec_helper_acceptance.rb +6 -0
  61. data/spec/spec_helper_acceptance_local.rb +38 -0
  62. data/spec/{puppet-lint → unit/puppet-lint}/bin_spec.rb +79 -35
  63. data/spec/{puppet-lint → unit/puppet-lint}/checks_spec.rb +36 -36
  64. data/spec/unit/puppet-lint/configuration_spec.rb +88 -0
  65. data/spec/{puppet-lint → unit/puppet-lint}/data_spec.rb +6 -3
  66. data/spec/{puppet-lint → unit/puppet-lint}/ignore_overrides_spec.rb +17 -17
  67. data/spec/{puppet-lint → unit/puppet-lint}/lexer/string_slurper_spec.rb +128 -128
  68. data/spec/{puppet-lint → unit/puppet-lint}/lexer/token_spec.rb +1 -1
  69. data/spec/{puppet-lint → unit/puppet-lint}/lexer_spec.rb +653 -671
  70. data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_classes/arrow_on_right_operand_line_spec.rb +16 -16
  71. data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_classes/autoloader_layout_spec.rb +13 -13
  72. data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_classes/class_inherits_from_params_class_spec.rb +3 -3
  73. data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_classes/code_on_top_scope_spec.rb +4 -4
  74. data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_classes/inherits_across_namespaces_spec.rb +4 -4
  75. data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_classes/name_contains_uppercase_spec.rb +10 -10
  76. data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_classes/names_containing_dash_spec.rb +7 -7
  77. data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_classes/nested_classes_or_defines_spec.rb +7 -7
  78. data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_classes/parameter_order_spec.rb +9 -9
  79. data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_classes/right_to_left_relationship_spec.rb +3 -3
  80. data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_classes/variable_scope_spec.rb +25 -25
  81. data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_comments/slash_comments_spec.rb +7 -7
  82. data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_comments/star_comments_spec.rb +13 -13
  83. data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_conditionals/case_without_default_spec.rb +10 -10
  84. data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_conditionals/selector_inside_resource_spec.rb +3 -3
  85. data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_documentation/documentation_spec.rb +8 -8
  86. data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_nodes/unquoted_node_name_spec.rb +24 -24
  87. data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_resources/duplicate_params_spec.rb +9 -9
  88. data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_resources/ensure_first_param_spec.rb +19 -19
  89. data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_resources/ensure_not_symlink_target_spec.rb +10 -10
  90. data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_resources/file_mode_spec.rb +40 -40
  91. data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_resources/unquoted_file_mode_spec.rb +20 -20
  92. data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_resources/unquoted_resource_title_spec.rb +24 -24
  93. data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_strings/double_quoted_strings_spec.rb +27 -27
  94. data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_strings/only_variable_string_spec.rb +18 -18
  95. data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_strings/puppet_url_without_modules_spec.rb +9 -9
  96. data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_strings/quoted_booleans_spec.rb +22 -22
  97. data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_strings/single_quote_string_with_variables_spec.rb +2 -2
  98. data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_strings/variables_not_enclosed_spec.rb +21 -21
  99. data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_variables/variable_contains_dash_spec.rb +6 -6
  100. data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_variables/variable_is_lowercase_spec.rb +7 -7
  101. data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_whitespace/140chars_spec.rb +5 -5
  102. data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_whitespace/2sp_soft_tabs_spec.rb +2 -2
  103. data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_whitespace/80chars_spec.rb +6 -6
  104. data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_whitespace/arrow_alignment_spec.rb +127 -127
  105. data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_whitespace/hard_tabs_spec.rb +7 -7
  106. data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_whitespace/trailing_whitespace_spec.rb +15 -15
  107. data/spec/unit/puppet-lint/puppet-lint_spec.rb +18 -0
  108. metadata +63 -119
  109. data/CHANGELOG.md +0 -33
  110. data/HISTORY.md +0 -1130
  111. data/spec/puppet-lint/configuration_spec.rb +0 -66
  112. data/spec/puppet-lint_spec.rb +0 -16
@@ -18,7 +18,7 @@ describe 'arrow_alignment' do
18
18
  END
19
19
  end
20
20
 
21
- it 'should not detect any problems' do
21
+ it 'does not detect any problems' do
22
22
  expect(problems).to have(0).problems
23
23
  end
24
24
  end
@@ -36,7 +36,7 @@ describe 'arrow_alignment' do
36
36
  END
37
37
  end
38
38
 
39
- it 'should not detect any problems' do
39
+ it 'does not detect any problems' do
40
40
  expect(problems).to have(0).problems
41
41
  end
42
42
  end
@@ -54,7 +54,7 @@ describe 'arrow_alignment' do
54
54
  END
55
55
  end
56
56
 
57
- it 'should not detect any problems' do
57
+ it 'does not detect any problems' do
58
58
  expect(problems).to have(0).problems
59
59
  end
60
60
  end
@@ -75,7 +75,7 @@ describe 'arrow_alignment' do
75
75
  END
76
76
  end
77
77
 
78
- it 'should not detect any problems' do
78
+ it 'does not detect any problems' do
79
79
  expect(problems).to have(0).problems
80
80
  end
81
81
  end
@@ -110,7 +110,7 @@ describe 'arrow_alignment' do
110
110
  END
111
111
  end
112
112
 
113
- it 'should not detect any problems' do
113
+ it 'does not detect any problems' do
114
114
  expect(problems).to have(0).problems
115
115
  end
116
116
  end
@@ -128,15 +128,15 @@ describe 'arrow_alignment' do
128
128
  END
129
129
  end
130
130
 
131
- it 'should detect four problems' do
131
+ it 'detects four problems' do
132
132
  expect(problems).to have(4).problems
133
133
  end
134
134
 
135
- it 'should create four warnings' do
136
- expect(problems).to contain_warning(format(msg, 19, 17)).on_line(2).in_column(17)
137
- expect(problems).to contain_warning(format(msg, 19, 17)).on_line(3).in_column(17)
138
- expect(problems).to contain_warning(format(msg, 19, 18)).on_line(5).in_column(18)
139
- expect(problems).to contain_warning(format(msg, 19, 17)).on_line(6).in_column(17)
135
+ it 'creates four warnings' do
136
+ expect(problems).to contain_warning(msg % [19, 17]).on_line(2).in_column(17)
137
+ expect(problems).to contain_warning(msg % [19, 17]).on_line(3).in_column(17)
138
+ expect(problems).to contain_warning(msg % [19, 18]).on_line(5).in_column(18)
139
+ expect(problems).to contain_warning(msg % [19, 17]).on_line(6).in_column(17)
140
140
  end
141
141
  end
142
142
 
@@ -153,15 +153,15 @@ describe 'arrow_alignment' do
153
153
  END
154
154
  end
155
155
 
156
- it 'should detect four problems' do
156
+ it 'detects four problems' do
157
157
  expect(problems).to have(4).problems
158
158
  end
159
159
 
160
- it 'should create four warnings' do
161
- expect(problems).to contain_warning(format(msg, 19, 17)).on_line(2).in_column(17)
162
- expect(problems).to contain_warning(format(msg, 19, 17)).on_line(3).in_column(17)
163
- expect(problems).to contain_warning(format(msg, 19, 18)).on_line(5).in_column(18)
164
- expect(problems).to contain_warning(format(msg, 19, 17)).on_line(6).in_column(17)
160
+ it 'creates four warnings' do
161
+ expect(problems).to contain_warning(msg % [19, 17]).on_line(2).in_column(17)
162
+ expect(problems).to contain_warning(msg % [19, 17]).on_line(3).in_column(17)
163
+ expect(problems).to contain_warning(msg % [19, 18]).on_line(5).in_column(18)
164
+ expect(problems).to contain_warning(msg % [19, 17]).on_line(6).in_column(17)
165
165
  end
166
166
  end
167
167
 
@@ -180,14 +180,14 @@ describe 'arrow_alignment' do
180
180
  END
181
181
  end
182
182
 
183
- it 'should detect three problems' do
183
+ it 'detects three problems' do
184
184
  expect(problems).to have(3).problems
185
185
  end
186
186
 
187
- it 'should create three warnings' do
188
- expect(problems).to contain_warning(format(msg, 18, 17)).on_line(2).in_column(17)
189
- expect(problems).to contain_warning(format(msg, 21, 19)).on_line(5).in_column(19)
190
- expect(problems).to contain_warning(format(msg, 18, 17)).on_line(8).in_column(17)
187
+ it 'creates three warnings' do
188
+ expect(problems).to contain_warning(msg % [18, 17]).on_line(2).in_column(17)
189
+ expect(problems).to contain_warning(msg % [21, 19]).on_line(5).in_column(19)
190
+ expect(problems).to contain_warning(msg % [18, 17]).on_line(8).in_column(17)
191
191
  end
192
192
  end
193
193
 
@@ -205,12 +205,12 @@ describe 'arrow_alignment' do
205
205
  END
206
206
  end
207
207
 
208
- it 'should only detect a single problem' do
208
+ it 'only detects a single problem' do
209
209
  expect(problems).to have(1).problem
210
210
  end
211
211
 
212
- it 'should create a warning' do
213
- expect(problems).to contain_warning(format(msg, 21, 19)).on_line(7).in_column(19)
212
+ it 'creates a warning' do
213
+ expect(problems).to contain_warning(msg % [21, 19]).on_line(7).in_column(19)
214
214
  end
215
215
  end
216
216
 
@@ -232,15 +232,15 @@ describe 'arrow_alignment' do
232
232
  END
233
233
  end
234
234
 
235
- it 'should only detect a single problem' do
235
+ it 'only detects a single problem' do
236
236
  expect(problems).to have(4).problem
237
237
  end
238
238
 
239
- it 'should create a warning' do
240
- expect(problems).to contain_warning(format(msg, 22, 21)).on_line(4).in_column(21)
241
- expect(problems).to contain_warning(format(msg, 22, 20)).on_line(5).in_column(20)
242
- expect(problems).to contain_warning(format(msg, 22, 21)).on_line(10).in_column(21)
243
- expect(problems).to contain_warning(format(msg, 22, 20)).on_line(11).in_column(20)
239
+ it 'creates a warning' do
240
+ expect(problems).to contain_warning(msg % [22, 21]).on_line(4).in_column(21)
241
+ expect(problems).to contain_warning(msg % [22, 20]).on_line(5).in_column(20)
242
+ expect(problems).to contain_warning(msg % [22, 21]).on_line(10).in_column(21)
243
+ expect(problems).to contain_warning(msg % [22, 20]).on_line(11).in_column(20)
244
244
  end
245
245
  end
246
246
 
@@ -252,7 +252,7 @@ describe 'arrow_alignment' do
252
252
  END
253
253
  end
254
254
 
255
- it 'should not detect any problems' do
255
+ it 'does not detect any problems' do
256
256
  expect(problems).to have(0).problems
257
257
  end
258
258
  end
@@ -267,7 +267,7 @@ describe 'arrow_alignment' do
267
267
  END
268
268
  end
269
269
 
270
- it 'should not detect any problems' do
270
+ it 'does not detect any problems' do
271
271
  expect(problems).to have(0).problems
272
272
  end
273
273
  end
@@ -281,7 +281,7 @@ describe 'arrow_alignment' do
281
281
  END
282
282
  end
283
283
 
284
- it 'should not detect any problems' do
284
+ it 'does not detect any problems' do
285
285
  expect(problems).to have(0).problems
286
286
  end
287
287
  end
@@ -295,7 +295,7 @@ describe 'arrow_alignment' do
295
295
  END
296
296
  end
297
297
 
298
- it 'should not detect any problems' do
298
+ it 'does not detect any problems' do
299
299
  expect(problems).to have(0).problems
300
300
  end
301
301
  end
@@ -310,13 +310,13 @@ describe 'arrow_alignment' do
310
310
  END
311
311
  end
312
312
 
313
- it 'should detect 2 problems' do
313
+ it 'detects 2 problems' do
314
314
  expect(problems).to have(2).problems
315
315
  end
316
316
 
317
- it 'should create 2 warnings' do
318
- expect(problems).to contain_warning(format(msg, 20, 21)).on_line(2).in_column(21)
319
- expect(problems).to contain_warning(format(msg, 20, 21)).on_line(3).in_column(21)
317
+ it 'creates 2 warnings' do
318
+ expect(problems).to contain_warning(msg % [20, 21]).on_line(2).in_column(21)
319
+ expect(problems).to contain_warning(msg % [20, 21]).on_line(3).in_column(21)
320
320
  end
321
321
  end
322
322
 
@@ -331,7 +331,7 @@ describe 'arrow_alignment' do
331
331
  END
332
332
  end
333
333
 
334
- it 'should not detect any problems' do
334
+ it 'does not detect any problems' do
335
335
  expect(problems).to have(0).problems
336
336
  end
337
337
  end
@@ -346,13 +346,13 @@ describe 'arrow_alignment' do
346
346
  END
347
347
  end
348
348
 
349
- it 'should detect 2 problems' do
349
+ it 'detects 2 problems' do
350
350
  expect(problems).to have(2).problems
351
351
  end
352
352
 
353
- it 'should create 2 warnings' do
354
- expect(problems).to contain_warning(format(msg, 17, 15)).on_line(2).in_column(15)
355
- expect(problems).to contain_warning(format(msg, 17, 28)).on_line(2).in_column(28)
353
+ it 'creates 2 warnings' do
354
+ expect(problems).to contain_warning(msg % [17, 15]).on_line(2).in_column(15)
355
+ expect(problems).to contain_warning(msg % [17, 28]).on_line(2).in_column(28)
356
356
  end
357
357
  end
358
358
 
@@ -366,7 +366,7 @@ describe 'arrow_alignment' do
366
366
  END
367
367
  end
368
368
 
369
- it 'should not detect any problems' do
369
+ it 'does not detect any problems' do
370
370
  expect(problems).to have(0).problems
371
371
  end
372
372
  end
@@ -383,7 +383,7 @@ describe 'arrow_alignment' do
383
383
  END
384
384
  end
385
385
 
386
- it 'should not detect any problems' do
386
+ it 'does not detect any problems' do
387
387
  expect(problems).to have(0).problems
388
388
  end
389
389
  end
@@ -400,12 +400,12 @@ describe 'arrow_alignment' do
400
400
  END
401
401
  end
402
402
 
403
- it 'should detect one problem' do
403
+ it 'detects one problem' do
404
404
  expect(problems).to have(1).problem
405
405
  end
406
406
 
407
- it 'should create one warning' do
408
- expect(problems).to contain_warning(format(msg, 20, 19)).on_line(4).in_column(19)
407
+ it 'creates one warning' do
408
+ expect(problems).to contain_warning(msg % [20, 19]).on_line(4).in_column(19)
409
409
  end
410
410
  end
411
411
 
@@ -422,7 +422,7 @@ describe 'arrow_alignment' do
422
422
  END
423
423
  end
424
424
 
425
- it 'should not detect any problems' do
425
+ it 'does not detect any problems' do
426
426
  expect(problems).to have(0).problems
427
427
  end
428
428
  end
@@ -440,13 +440,13 @@ describe 'arrow_alignment' do
440
440
  END
441
441
  end
442
442
 
443
- it 'should detect 2 problems' do
443
+ it 'detects 2 problems' do
444
444
  expect(problems).to have(2).problems
445
445
  end
446
446
 
447
- it 'should create 2 warnings' do
448
- expect(problems).to contain_warning(format(msg, 25, 17)).on_line(3).in_column(17)
449
- expect(problems).to contain_warning(format(msg, 25, 21)).on_line(5).in_column(21)
447
+ it 'creates 2 warnings' do
448
+ expect(problems).to contain_warning(msg % [25, 17]).on_line(3).in_column(17)
449
+ expect(problems).to contain_warning(msg % [25, 21]).on_line(5).in_column(21)
450
450
  end
451
451
  end
452
452
 
@@ -469,7 +469,7 @@ describe 'arrow_alignment' do
469
469
  END
470
470
  end
471
471
 
472
- it 'should not detect any problems' do
472
+ it 'does not detect any problems' do
473
473
  expect(problems).to have(0).problems
474
474
  end
475
475
  end
@@ -488,18 +488,18 @@ describe 'arrow_alignment' do
488
488
  END
489
489
  end
490
490
 
491
- it 'should not detect any problems' do
491
+ it 'does not detect any problems' do
492
492
  expect(problems).to have(0).problems
493
493
  end
494
494
  end
495
495
  end
496
496
 
497
497
  context 'with fix enabled' do
498
- before do
498
+ before(:each) do
499
499
  PuppetLint.configuration.fix = true
500
500
  end
501
501
 
502
- after do
502
+ after(:each) do
503
503
  PuppetLint.configuration.fix = false
504
504
  end
505
505
 
@@ -528,18 +528,18 @@ describe 'arrow_alignment' do
528
528
  END
529
529
  end
530
530
 
531
- it 'should detect four problems' do
531
+ it 'detects four problems' do
532
532
  expect(problems).to have(4).problems
533
533
  end
534
534
 
535
- it 'should fix the manifest' do
536
- expect(problems).to contain_fixed(format(msg, 19, 17)).on_line(2).in_column(17)
537
- expect(problems).to contain_fixed(format(msg, 19, 17)).on_line(3).in_column(17)
538
- expect(problems).to contain_fixed(format(msg, 19, 18)).on_line(5).in_column(18)
539
- expect(problems).to contain_fixed(format(msg, 19, 17)).on_line(6).in_column(17)
535
+ it 'fixes the manifest' do
536
+ expect(problems).to contain_fixed(msg % [19, 17]).on_line(2).in_column(17)
537
+ expect(problems).to contain_fixed(msg % [19, 17]).on_line(3).in_column(17)
538
+ expect(problems).to contain_fixed(msg % [19, 18]).on_line(5).in_column(18)
539
+ expect(problems).to contain_fixed(msg % [19, 17]).on_line(6).in_column(17)
540
540
  end
541
541
 
542
- it 'should align the arrows' do
542
+ it 'aligns the arrows' do
543
543
  expect(manifest).to eq(fixed)
544
544
  end
545
545
  end
@@ -573,17 +573,17 @@ describe 'arrow_alignment' do
573
573
  END
574
574
  end
575
575
 
576
- it 'should detect three problems' do
576
+ it 'detects three problems' do
577
577
  expect(problems).to have(3).problems
578
578
  end
579
579
 
580
- it 'should fix the manifest' do
581
- expect(problems).to contain_fixed(format(msg, 18, 17)).on_line(2).in_column(17)
582
- expect(problems).to contain_fixed(format(msg, 21, 19)).on_line(5).in_column(19)
583
- expect(problems).to contain_fixed(format(msg, 18, 17)).on_line(8).in_column(17)
580
+ it 'fixes the manifest' do
581
+ expect(problems).to contain_fixed(msg % [18, 17]).on_line(2).in_column(17)
582
+ expect(problems).to contain_fixed(msg % [21, 19]).on_line(5).in_column(19)
583
+ expect(problems).to contain_fixed(msg % [18, 17]).on_line(8).in_column(17)
584
584
  end
585
585
 
586
- it 'should align the arrows' do
586
+ it 'aligns the arrows' do
587
587
  expect(manifest).to eq(fixed)
588
588
  end
589
589
  end
@@ -615,15 +615,15 @@ describe 'arrow_alignment' do
615
615
  END
616
616
  end
617
617
 
618
- it 'should only detect a single problem' do
618
+ it 'only detects a single problem' do
619
619
  expect(problems).to have(1).problem
620
620
  end
621
621
 
622
- it 'should fix the manifest' do
623
- expect(problems).to contain_fixed(format(msg, 21, 19)).on_line(7).in_column(19)
622
+ it 'fixes the manifest' do
623
+ expect(problems).to contain_fixed(msg % [21, 19]).on_line(7).in_column(19)
624
624
  end
625
625
 
626
- it 'should align the arrows' do
626
+ it 'aligns the arrows' do
627
627
  expect(manifest).to eq(fixed)
628
628
  end
629
629
  end
@@ -647,16 +647,16 @@ describe 'arrow_alignment' do
647
647
  END
648
648
  end
649
649
 
650
- it 'should detect 2 problems' do
650
+ it 'detects 2 problems' do
651
651
  expect(problems).to have(2).problems
652
652
  end
653
653
 
654
- it 'should create 2 warnings' do
655
- expect(problems).to contain_fixed(format(msg, 20, 21)).on_line(2).in_column(21)
656
- expect(problems).to contain_fixed(format(msg, 20, 21)).on_line(3).in_column(21)
654
+ it 'creates 2 warnings' do
655
+ expect(problems).to contain_fixed(msg % [20, 21]).on_line(2).in_column(21)
656
+ expect(problems).to contain_fixed(msg % [20, 21]).on_line(3).in_column(21)
657
657
  end
658
658
 
659
- it 'should realign the arrows with the minimum whitespace' do
659
+ it 'realigns the arrows with the minimum whitespace' do
660
660
  expect(manifest).to eq(fixed)
661
661
  end
662
662
  end
@@ -680,15 +680,15 @@ describe 'arrow_alignment' do
680
680
  END
681
681
  end
682
682
 
683
- it 'should detect 1 problem' do
683
+ it 'detects 1 problem' do
684
684
  expect(problems).to have(1).problem
685
685
  end
686
686
 
687
- it 'should fix the problem' do
688
- expect(problems).to contain_fixed(format(msg, 20, 19)).on_line(3).in_column(19)
687
+ it 'fixes the problem' do
688
+ expect(problems).to contain_fixed(msg % [20, 19]).on_line(3).in_column(19)
689
689
  end
690
690
 
691
- it 'should add whitespace between the param and the arrow' do
691
+ it 'adds whitespace between the param and the arrow' do
692
692
  expect(manifest).to eq(fixed)
693
693
  end
694
694
  end
@@ -713,16 +713,16 @@ describe 'arrow_alignment' do
713
713
  END
714
714
  end
715
715
 
716
- it 'should detect 2 problems' do
716
+ it 'detects 2 problems' do
717
717
  expect(problems).to have(2).problems
718
718
  end
719
719
 
720
- it 'should fix 2 problems' do
721
- expect(problems).to contain_fixed(format(msg, 17, 15)).on_line(2).in_column(15)
722
- expect(problems).to contain_fixed(format(msg, 17, 28)).on_line(2).in_column(28)
720
+ it 'fixes 2 problems' do
721
+ expect(problems).to contain_fixed(msg % [17, 15]).on_line(2).in_column(15)
722
+ expect(problems).to contain_fixed(msg % [17, 28]).on_line(2).in_column(28)
723
723
  end
724
724
 
725
- it 'should move the extra param onto its own line and realign' do
725
+ it 'moves the extra param onto its own line and realign' do
726
726
  expect(manifest).to eq(fixed)
727
727
  end
728
728
  end
@@ -747,17 +747,17 @@ describe 'arrow_alignment' do
747
747
  END
748
748
  end
749
749
 
750
- it 'should detect 2 problems' do
750
+ it 'detects 2 problems' do
751
751
  expect(problems).to have(3).problems
752
752
  end
753
753
 
754
- it 'should fix 2 problems' do
755
- expect(problems).to contain_fixed(format(msg, 19, 15)).on_line(2).in_column(15)
756
- expect(problems).to contain_fixed(format(msg, 19, 31)).on_line(2).in_column(31)
757
- expect(problems).to contain_fixed(format(msg, 19, 17)).on_line(3).in_column(17)
754
+ it 'fixes 2 problems' do
755
+ expect(problems).to contain_fixed(msg % [19, 15]).on_line(2).in_column(15)
756
+ expect(problems).to contain_fixed(msg % [19, 31]).on_line(2).in_column(31)
757
+ expect(problems).to contain_fixed(msg % [19, 17]).on_line(3).in_column(17)
758
758
  end
759
759
 
760
- it 'should move the extra param onto its own line and realign' do
760
+ it 'moves the extra param onto its own line and realign' do
761
761
  expect(manifest).to eq(fixed)
762
762
  end
763
763
  end
@@ -787,16 +787,16 @@ describe 'arrow_alignment' do
787
787
  END
788
788
  end
789
789
 
790
- it 'should detect 2 problems' do
790
+ it 'detects 2 problems' do
791
791
  expect(problems).to have(2).problems
792
792
  end
793
793
 
794
- it 'should fix 2 problems' do
795
- expect(problems).to contain_fixed(format(msg, 25, 17)).on_line(3).in_column(17)
796
- expect(problems).to contain_fixed(format(msg, 25, 21)).on_line(5).in_column(21)
794
+ it 'fixes 2 problems' do
795
+ expect(problems).to contain_fixed(msg % [25, 17]).on_line(3).in_column(17)
796
+ expect(problems).to contain_fixed(msg % [25, 21]).on_line(5).in_column(21)
797
797
  end
798
798
 
799
- it 'should align the hash rockets' do
799
+ it 'aligns the hash rockets' do
800
800
  expect(manifest).to eq(fixed)
801
801
  end
802
802
  end
@@ -838,15 +838,15 @@ describe 'arrow_alignment' do
838
838
  END
839
839
  end
840
840
 
841
- it 'should detect 1 problem' do
841
+ it 'detects 1 problem' do
842
842
  expect(problems).to have(1).problems
843
843
  end
844
844
 
845
- it 'should fix 1 problem' do
846
- expect(problems).to contain_fixed(format(msg, 23, 24)).on_line(9).in_column(24)
845
+ it 'fixes 1 problem' do
846
+ expect(problems).to contain_fixed(msg % [23, 24]).on_line(9).in_column(24)
847
847
  end
848
848
 
849
- it 'should align the hash rockets' do
849
+ it 'aligns the hash rockets' do
850
850
  expect(manifest).to eq(fixed)
851
851
  end
852
852
  end
@@ -896,19 +896,19 @@ describe 'arrow_alignment' do
896
896
  END
897
897
  end
898
898
 
899
- it 'should detect 5 problems' do
899
+ it 'detects 5 problems' do
900
900
  expect(problems).to have(5).problems
901
901
  end
902
902
 
903
- it 'should fix 5 problems' do
904
- expect(problems).to contain_fixed(format(msg, 53, 38)).on_line(9).in_column(38)
905
- expect(problems).to contain_fixed(format(msg, 53, 17)).on_line(10).in_column(17)
906
- expect(problems).to contain_fixed(format(msg, 53, 12)).on_line(11).in_column(12)
907
- expect(problems).to contain_fixed(format(msg, 53, 13)).on_line(12).in_column(13)
908
- expect(problems).to contain_fixed(format(msg, 53, 10)).on_line(13).in_column(10)
903
+ it 'fixes 5 problems' do
904
+ expect(problems).to contain_fixed(msg % [53, 38]).on_line(9).in_column(38)
905
+ expect(problems).to contain_fixed(msg % [53, 17]).on_line(10).in_column(17)
906
+ expect(problems).to contain_fixed(msg % [53, 12]).on_line(11).in_column(12)
907
+ expect(problems).to contain_fixed(msg % [53, 13]).on_line(12).in_column(13)
908
+ expect(problems).to contain_fixed(msg % [53, 10]).on_line(13).in_column(10)
909
909
  end
910
910
 
911
- it 'should realign the arrows' do
911
+ it 'realigns the arrows' do
912
912
  expect(manifest).to eq(fixed)
913
913
  end
914
914
  end
@@ -948,22 +948,22 @@ describe 'arrow_alignment' do
948
948
  END
949
949
  end
950
950
 
951
- it 'should detect 8 problems' do
951
+ it 'detects 8 problems' do
952
952
  expect(problems).to have(8).problems
953
953
  end
954
954
 
955
- it 'should fix 8 problems' do
956
- expect(problems).to contain_fixed(format(msg, 24, 27)).on_line(2).in_column(27)
957
- expect(problems).to contain_fixed(format(msg, 24, 27)).on_line(5).in_column(27)
958
- expect(problems).to contain_fixed(format(msg, 24, 27)).on_line(6).in_column(27)
959
- expect(problems).to contain_fixed(format(msg, 24, 27)).on_line(7).in_column(27)
960
- expect(problems).to contain_fixed(format(msg, 24, 27)).on_line(8).in_column(27)
961
- expect(problems).to contain_fixed(format(msg, 24, 27)).on_line(9).in_column(27)
962
- expect(problems).to contain_fixed(format(msg, 24, 27)).on_line(10).in_column(27)
963
- expect(problems).to contain_fixed(format(msg, 24, 27)).on_line(11).in_column(27)
955
+ it 'fixes 8 problems' do
956
+ expect(problems).to contain_fixed(msg % [24, 27]).on_line(2).in_column(27)
957
+ expect(problems).to contain_fixed(msg % [24, 27]).on_line(5).in_column(27)
958
+ expect(problems).to contain_fixed(msg % [24, 27]).on_line(6).in_column(27)
959
+ expect(problems).to contain_fixed(msg % [24, 27]).on_line(7).in_column(27)
960
+ expect(problems).to contain_fixed(msg % [24, 27]).on_line(8).in_column(27)
961
+ expect(problems).to contain_fixed(msg % [24, 27]).on_line(9).in_column(27)
962
+ expect(problems).to contain_fixed(msg % [24, 27]).on_line(10).in_column(27)
963
+ expect(problems).to contain_fixed(msg % [24, 27]).on_line(11).in_column(27)
964
964
  end
965
965
 
966
- it 'should realign the arrows' do
966
+ it 'realigns the arrows' do
967
967
  expect(manifest).to eq(fixed)
968
968
  end
969
969
  end
@@ -992,15 +992,15 @@ describe 'arrow_alignment' do
992
992
  END
993
993
  end
994
994
 
995
- it 'should detect a problem' do
995
+ it 'detects a problem' do
996
996
  expect(problems).to have(1).problem
997
997
  end
998
998
 
999
- it 'should fix the problems' do
1000
- expect(problems).to contain_fixed(format(msg, 24, 20)).on_line(3).in_column(20)
999
+ it 'fixes the problems' do
1000
+ expect(problems).to contain_fixed(msg % [24, 20]).on_line(3).in_column(20)
1001
1001
  end
1002
1002
 
1003
- it 'should realign the arrows' do
1003
+ it 'realigns the arrows' do
1004
1004
  expect(manifest).to eq(fixed)
1005
1005
  end
1006
1006
  end
@@ -7,37 +7,37 @@ describe 'hard_tabs' do
7
7
  context 'hard tabs indents' do
8
8
  let(:code) { "\tfoo => bar," }
9
9
 
10
- it 'should only detect a single problem' do
10
+ it 'only detects a single problem' do
11
11
  expect(problems).to have(1).problem
12
12
  end
13
13
 
14
- it 'should create an error' do
14
+ it 'creates an error' do
15
15
  expect(problems).to contain_error(msg).on_line(1).in_column(1)
16
16
  end
17
17
  end
18
18
  end
19
19
 
20
20
  context 'with fix enabled' do
21
- before do
21
+ before(:each) do
22
22
  PuppetLint.configuration.fix = true
23
23
  end
24
24
 
25
- after do
25
+ after(:each) do
26
26
  PuppetLint.configuration.fix = false
27
27
  end
28
28
 
29
29
  context 'hard tabs indents' do
30
30
  let(:code) { "\tfoo => bar," }
31
31
 
32
- it 'should only detect a single problem' do
32
+ it 'only detects a single problem' do
33
33
  expect(problems).to have(1).problem
34
34
  end
35
35
 
36
- it 'should fix the manifest' do
36
+ it 'fixes the manifest' do
37
37
  expect(problems).to contain_fixed(msg).on_line(1).in_column(1)
38
38
  end
39
39
 
40
- it 'should convert the tab characters into spaces' do
40
+ it 'converts the tab characters into spaces' do
41
41
  expect(manifest).to eq(' foo => bar,')
42
42
  end
43
43
  end