puppet-lint 2.5.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop.yml +522 -0
- data/lib/puppet-lint/bin.rb +71 -6
- data/lib/puppet-lint/checkplugin.rb +43 -9
- data/lib/puppet-lint/checks.rb +16 -16
- data/lib/puppet-lint/configuration.rb +134 -134
- data/lib/puppet-lint/data.rb +28 -28
- data/lib/puppet-lint/lexer/string_slurper.rb +138 -140
- data/lib/puppet-lint/lexer/token.rb +188 -190
- data/lib/puppet-lint/lexer.rb +416 -417
- data/lib/puppet-lint/monkeypatches.rb +1 -1
- data/lib/puppet-lint/optparser.rb +5 -1
- data/lib/puppet-lint/plugins/check_classes/arrow_on_right_operand_line.rb +6 -4
- data/lib/puppet-lint/plugins/check_classes/autoloader_layout.rb +5 -3
- data/lib/puppet-lint/plugins/check_classes/class_inherits_from_params_class.rb +6 -4
- data/lib/puppet-lint/plugins/check_classes/code_on_top_scope.rb +5 -3
- data/lib/puppet-lint/plugins/check_classes/inherits_across_namespaces.rb +5 -3
- data/lib/puppet-lint/plugins/check_classes/names_containing_dash.rb +5 -3
- data/lib/puppet-lint/plugins/check_classes/names_containing_uppercase.rb +7 -5
- data/lib/puppet-lint/plugins/check_classes/nested_classes_or_defines.rb +5 -3
- data/lib/puppet-lint/plugins/check_classes/parameter_order.rb +7 -4
- data/lib/puppet-lint/plugins/check_classes/right_to_left_relationship.rb +5 -3
- data/lib/puppet-lint/plugins/check_classes/variable_scope.rb +15 -13
- data/lib/puppet-lint/plugins/check_comments/slash_comments.rb +9 -7
- data/lib/puppet-lint/plugins/check_comments/star_comments.rb +10 -8
- data/lib/puppet-lint/plugins/check_conditionals/case_without_default.rb +6 -4
- data/lib/puppet-lint/plugins/check_conditionals/selector_inside_resource.rb +5 -3
- data/lib/puppet-lint/plugins/check_documentation/documentation.rb +7 -3
- data/lib/puppet-lint/plugins/check_nodes/unquoted_node_name.rb +15 -11
- data/lib/puppet-lint/plugins/check_resources/duplicate_params.rb +5 -3
- data/lib/puppet-lint/plugins/check_resources/ensure_first_param.rb +8 -5
- data/lib/puppet-lint/plugins/check_resources/ensure_not_symlink_target.rb +11 -8
- data/lib/puppet-lint/plugins/check_resources/file_mode.rb +14 -9
- data/lib/puppet-lint/plugins/check_resources/unquoted_file_mode.rb +11 -6
- data/lib/puppet-lint/plugins/check_resources/unquoted_resource_title.rb +6 -4
- data/lib/puppet-lint/plugins/check_strings/double_quoted_strings.rb +12 -7
- data/lib/puppet-lint/plugins/check_strings/only_variable_string.rb +8 -6
- data/lib/puppet-lint/plugins/check_strings/puppet_url_without_modules.rb +14 -8
- data/lib/puppet-lint/plugins/check_strings/quoted_booleans.rb +11 -7
- data/lib/puppet-lint/plugins/check_strings/single_quote_string_with_variables.rb +11 -6
- data/lib/puppet-lint/plugins/check_strings/variables_not_enclosed.rb +12 -8
- data/lib/puppet-lint/plugins/check_variables/variable_contains_dash.rb +11 -7
- data/lib/puppet-lint/plugins/check_variables/variable_is_lowercase.rb +11 -7
- data/lib/puppet-lint/plugins/check_whitespace/140chars.rb +3 -8
- data/lib/puppet-lint/plugins/check_whitespace/2sp_soft_tabs.rb +10 -8
- data/lib/puppet-lint/plugins/check_whitespace/80chars.rb +3 -8
- data/lib/puppet-lint/plugins/check_whitespace/arrow_alignment.rb +10 -8
- data/lib/puppet-lint/plugins/check_whitespace/hard_tabs.rb +11 -7
- data/lib/puppet-lint/plugins/check_whitespace/line_length.rb +29 -0
- data/lib/puppet-lint/plugins/check_whitespace/trailing_whitespace.rb +13 -7
- data/lib/puppet-lint/plugins.rb +63 -61
- data/lib/puppet-lint/report/github.rb +17 -0
- data/lib/puppet-lint/report/sarif_template.json +63 -0
- data/lib/puppet-lint/tasks/puppet-lint.rb +84 -83
- data/lib/puppet-lint/tasks/release_test.rb +4 -1
- data/lib/puppet-lint/version.rb +1 -1
- data/lib/puppet-lint.rb +27 -12
- data/spec/acceptance/puppet_lint_spec.rb +46 -0
- data/spec/spec_helper.rb +92 -91
- data/spec/spec_helper_acceptance.rb +6 -0
- data/spec/spec_helper_acceptance_local.rb +38 -0
- data/spec/{puppet-lint → unit/puppet-lint}/bin_spec.rb +79 -35
- data/spec/{puppet-lint → unit/puppet-lint}/checks_spec.rb +36 -36
- data/spec/unit/puppet-lint/configuration_spec.rb +88 -0
- data/spec/{puppet-lint → unit/puppet-lint}/data_spec.rb +6 -3
- data/spec/{puppet-lint → unit/puppet-lint}/ignore_overrides_spec.rb +17 -17
- data/spec/{puppet-lint → unit/puppet-lint}/lexer/string_slurper_spec.rb +128 -128
- data/spec/{puppet-lint → unit/puppet-lint}/lexer/token_spec.rb +1 -1
- data/spec/{puppet-lint → unit/puppet-lint}/lexer_spec.rb +653 -671
- data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_classes/arrow_on_right_operand_line_spec.rb +16 -16
- data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_classes/autoloader_layout_spec.rb +13 -13
- data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_classes/class_inherits_from_params_class_spec.rb +3 -3
- data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_classes/code_on_top_scope_spec.rb +4 -4
- data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_classes/inherits_across_namespaces_spec.rb +4 -4
- data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_classes/name_contains_uppercase_spec.rb +10 -10
- data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_classes/names_containing_dash_spec.rb +7 -7
- data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_classes/nested_classes_or_defines_spec.rb +7 -7
- data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_classes/parameter_order_spec.rb +9 -9
- data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_classes/right_to_left_relationship_spec.rb +3 -3
- data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_classes/variable_scope_spec.rb +25 -25
- data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_comments/slash_comments_spec.rb +7 -7
- data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_comments/star_comments_spec.rb +13 -13
- data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_conditionals/case_without_default_spec.rb +10 -10
- data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_conditionals/selector_inside_resource_spec.rb +3 -3
- data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_documentation/documentation_spec.rb +8 -8
- data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_nodes/unquoted_node_name_spec.rb +24 -24
- data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_resources/duplicate_params_spec.rb +9 -9
- data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_resources/ensure_first_param_spec.rb +19 -19
- data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_resources/ensure_not_symlink_target_spec.rb +10 -10
- data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_resources/file_mode_spec.rb +40 -40
- data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_resources/unquoted_file_mode_spec.rb +20 -20
- data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_resources/unquoted_resource_title_spec.rb +24 -24
- data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_strings/double_quoted_strings_spec.rb +28 -27
- data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_strings/only_variable_string_spec.rb +18 -18
- data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_strings/puppet_url_without_modules_spec.rb +9 -9
- data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_strings/quoted_booleans_spec.rb +22 -22
- data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_strings/single_quote_string_with_variables_spec.rb +2 -2
- data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_strings/variables_not_enclosed_spec.rb +21 -21
- data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_variables/variable_contains_dash_spec.rb +6 -6
- data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_variables/variable_is_lowercase_spec.rb +7 -7
- data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_whitespace/140chars_spec.rb +5 -5
- data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_whitespace/2sp_soft_tabs_spec.rb +2 -2
- data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_whitespace/80chars_spec.rb +6 -6
- data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_whitespace/arrow_alignment_spec.rb +127 -127
- data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_whitespace/hard_tabs_spec.rb +7 -7
- data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_whitespace/trailing_whitespace_spec.rb +15 -15
- data/spec/unit/puppet-lint/puppet-lint_spec.rb +18 -0
- metadata +69 -120
- data/CHANGELOG.md +0 -1130
- data/spec/puppet-lint/configuration_spec.rb +0 -66
- 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 '
|
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 '
|
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 '
|
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 '
|
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 '
|
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 '
|
131
|
+
it 'detects four problems' do
|
132
132
|
expect(problems).to have(4).problems
|
133
133
|
end
|
134
134
|
|
135
|
-
it '
|
136
|
-
expect(problems).to contain_warning(
|
137
|
-
expect(problems).to contain_warning(
|
138
|
-
expect(problems).to contain_warning(
|
139
|
-
expect(problems).to contain_warning(
|
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 '
|
156
|
+
it 'detects four problems' do
|
157
157
|
expect(problems).to have(4).problems
|
158
158
|
end
|
159
159
|
|
160
|
-
it '
|
161
|
-
expect(problems).to contain_warning(
|
162
|
-
expect(problems).to contain_warning(
|
163
|
-
expect(problems).to contain_warning(
|
164
|
-
expect(problems).to contain_warning(
|
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 '
|
183
|
+
it 'detects three problems' do
|
184
184
|
expect(problems).to have(3).problems
|
185
185
|
end
|
186
186
|
|
187
|
-
it '
|
188
|
-
expect(problems).to contain_warning(
|
189
|
-
expect(problems).to contain_warning(
|
190
|
-
expect(problems).to contain_warning(
|
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 '
|
208
|
+
it 'only detects a single problem' do
|
209
209
|
expect(problems).to have(1).problem
|
210
210
|
end
|
211
211
|
|
212
|
-
it '
|
213
|
-
expect(problems).to contain_warning(
|
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 '
|
235
|
+
it 'only detects a single problem' do
|
236
236
|
expect(problems).to have(4).problem
|
237
237
|
end
|
238
238
|
|
239
|
-
it '
|
240
|
-
expect(problems).to contain_warning(
|
241
|
-
expect(problems).to contain_warning(
|
242
|
-
expect(problems).to contain_warning(
|
243
|
-
expect(problems).to contain_warning(
|
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 '
|
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 '
|
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 '
|
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 '
|
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 '
|
313
|
+
it 'detects 2 problems' do
|
314
314
|
expect(problems).to have(2).problems
|
315
315
|
end
|
316
316
|
|
317
|
-
it '
|
318
|
-
expect(problems).to contain_warning(
|
319
|
-
expect(problems).to contain_warning(
|
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 '
|
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 '
|
349
|
+
it 'detects 2 problems' do
|
350
350
|
expect(problems).to have(2).problems
|
351
351
|
end
|
352
352
|
|
353
|
-
it '
|
354
|
-
expect(problems).to contain_warning(
|
355
|
-
expect(problems).to contain_warning(
|
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 '
|
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 '
|
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 '
|
403
|
+
it 'detects one problem' do
|
404
404
|
expect(problems).to have(1).problem
|
405
405
|
end
|
406
406
|
|
407
|
-
it '
|
408
|
-
expect(problems).to contain_warning(
|
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 '
|
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 '
|
443
|
+
it 'detects 2 problems' do
|
444
444
|
expect(problems).to have(2).problems
|
445
445
|
end
|
446
446
|
|
447
|
-
it '
|
448
|
-
expect(problems).to contain_warning(
|
449
|
-
expect(problems).to contain_warning(
|
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 '
|
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 '
|
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 '
|
531
|
+
it 'detects four problems' do
|
532
532
|
expect(problems).to have(4).problems
|
533
533
|
end
|
534
534
|
|
535
|
-
it '
|
536
|
-
expect(problems).to contain_fixed(
|
537
|
-
expect(problems).to contain_fixed(
|
538
|
-
expect(problems).to contain_fixed(
|
539
|
-
expect(problems).to contain_fixed(
|
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 '
|
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 '
|
576
|
+
it 'detects three problems' do
|
577
577
|
expect(problems).to have(3).problems
|
578
578
|
end
|
579
579
|
|
580
|
-
it '
|
581
|
-
expect(problems).to contain_fixed(
|
582
|
-
expect(problems).to contain_fixed(
|
583
|
-
expect(problems).to contain_fixed(
|
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 '
|
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 '
|
618
|
+
it 'only detects a single problem' do
|
619
619
|
expect(problems).to have(1).problem
|
620
620
|
end
|
621
621
|
|
622
|
-
it '
|
623
|
-
expect(problems).to contain_fixed(
|
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 '
|
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 '
|
650
|
+
it 'detects 2 problems' do
|
651
651
|
expect(problems).to have(2).problems
|
652
652
|
end
|
653
653
|
|
654
|
-
it '
|
655
|
-
expect(problems).to contain_fixed(
|
656
|
-
expect(problems).to contain_fixed(
|
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 '
|
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 '
|
683
|
+
it 'detects 1 problem' do
|
684
684
|
expect(problems).to have(1).problem
|
685
685
|
end
|
686
686
|
|
687
|
-
it '
|
688
|
-
expect(problems).to contain_fixed(
|
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 '
|
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 '
|
716
|
+
it 'detects 2 problems' do
|
717
717
|
expect(problems).to have(2).problems
|
718
718
|
end
|
719
719
|
|
720
|
-
it '
|
721
|
-
expect(problems).to contain_fixed(
|
722
|
-
expect(problems).to contain_fixed(
|
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 '
|
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 '
|
750
|
+
it 'detects 2 problems' do
|
751
751
|
expect(problems).to have(3).problems
|
752
752
|
end
|
753
753
|
|
754
|
-
it '
|
755
|
-
expect(problems).to contain_fixed(
|
756
|
-
expect(problems).to contain_fixed(
|
757
|
-
expect(problems).to contain_fixed(
|
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 '
|
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 '
|
790
|
+
it 'detects 2 problems' do
|
791
791
|
expect(problems).to have(2).problems
|
792
792
|
end
|
793
793
|
|
794
|
-
it '
|
795
|
-
expect(problems).to contain_fixed(
|
796
|
-
expect(problems).to contain_fixed(
|
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 '
|
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 '
|
841
|
+
it 'detects 1 problem' do
|
842
842
|
expect(problems).to have(1).problems
|
843
843
|
end
|
844
844
|
|
845
|
-
it '
|
846
|
-
expect(problems).to contain_fixed(
|
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 '
|
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 '
|
899
|
+
it 'detects 5 problems' do
|
900
900
|
expect(problems).to have(5).problems
|
901
901
|
end
|
902
902
|
|
903
|
-
it '
|
904
|
-
expect(problems).to contain_fixed(
|
905
|
-
expect(problems).to contain_fixed(
|
906
|
-
expect(problems).to contain_fixed(
|
907
|
-
expect(problems).to contain_fixed(
|
908
|
-
expect(problems).to contain_fixed(
|
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 '
|
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 '
|
951
|
+
it 'detects 8 problems' do
|
952
952
|
expect(problems).to have(8).problems
|
953
953
|
end
|
954
954
|
|
955
|
-
it '
|
956
|
-
expect(problems).to contain_fixed(
|
957
|
-
expect(problems).to contain_fixed(
|
958
|
-
expect(problems).to contain_fixed(
|
959
|
-
expect(problems).to contain_fixed(
|
960
|
-
expect(problems).to contain_fixed(
|
961
|
-
expect(problems).to contain_fixed(
|
962
|
-
expect(problems).to contain_fixed(
|
963
|
-
expect(problems).to contain_fixed(
|
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 '
|
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 '
|
995
|
+
it 'detects a problem' do
|
996
996
|
expect(problems).to have(1).problem
|
997
997
|
end
|
998
998
|
|
999
|
-
it '
|
1000
|
-
expect(problems).to contain_fixed(
|
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 '
|
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 '
|
10
|
+
it 'only detects a single problem' do
|
11
11
|
expect(problems).to have(1).problem
|
12
12
|
end
|
13
13
|
|
14
|
-
it '
|
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 '
|
32
|
+
it 'only detects a single problem' do
|
33
33
|
expect(problems).to have(1).problem
|
34
34
|
end
|
35
35
|
|
36
|
-
it '
|
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 '
|
40
|
+
it 'converts the tab characters into spaces' do
|
41
41
|
expect(manifest).to eq(' foo => bar,')
|
42
42
|
end
|
43
43
|
end
|