foodcritic 2.2.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.
Files changed (76) hide show
  1. checksums.yaml +15 -0
  2. data/CHANGELOG.md +83 -0
  3. data/chef_dsl_metadata/chef_0.10.0.json +2 -3
  4. data/chef_dsl_metadata/chef_0.10.10.json +2 -3
  5. data/chef_dsl_metadata/chef_0.10.2.json +2 -3
  6. data/chef_dsl_metadata/chef_0.10.4.json +2 -3
  7. data/chef_dsl_metadata/chef_0.10.6.json +2 -3
  8. data/chef_dsl_metadata/chef_0.10.8.json +2 -3
  9. data/chef_dsl_metadata/chef_0.8.14.json +2 -3
  10. data/chef_dsl_metadata/chef_0.8.16.json +2 -3
  11. data/chef_dsl_metadata/chef_0.9.0.json +2 -3
  12. data/chef_dsl_metadata/chef_0.9.10.json +2 -3
  13. data/chef_dsl_metadata/chef_0.9.12.json +2 -3
  14. data/chef_dsl_metadata/chef_0.9.14.json +2 -3
  15. data/chef_dsl_metadata/chef_0.9.16.json +2 -3
  16. data/chef_dsl_metadata/chef_0.9.18.json +2 -3
  17. data/chef_dsl_metadata/chef_0.9.2.json +2 -3
  18. data/chef_dsl_metadata/chef_0.9.4.json +2 -3
  19. data/chef_dsl_metadata/chef_0.9.6.json +2 -3
  20. data/chef_dsl_metadata/chef_0.9.8.json +2 -3
  21. data/chef_dsl_metadata/chef_10.12.0.json +2 -3
  22. data/chef_dsl_metadata/chef_10.14.0.json +2 -3
  23. data/chef_dsl_metadata/chef_10.14.2.json +2 -3
  24. data/chef_dsl_metadata/chef_10.14.4.json +2 -3
  25. data/chef_dsl_metadata/chef_10.16.0.json +2 -3
  26. data/chef_dsl_metadata/chef_10.16.2.json +2 -3
  27. data/chef_dsl_metadata/chef_10.16.4.json +2 -3
  28. data/chef_dsl_metadata/chef_10.16.6.json +2 -3
  29. data/chef_dsl_metadata/chef_10.18.0.json +2 -3
  30. data/chef_dsl_metadata/chef_10.18.2.json +2 -3
  31. data/chef_dsl_metadata/chef_10.20.0.json +2 -3
  32. data/chef_dsl_metadata/chef_10.22.0.json +2 -3
  33. data/chef_dsl_metadata/chef_10.24.0.json +2 -3
  34. data/chef_dsl_metadata/chef_10.24.4.json +2 -3
  35. data/chef_dsl_metadata/chef_10.26.0.json +2 -3
  36. data/chef_dsl_metadata/chef_11.0.0.json +2 -3
  37. data/chef_dsl_metadata/chef_11.2.0.json +2 -3
  38. data/chef_dsl_metadata/chef_11.4.0.json +2 -3
  39. data/chef_dsl_metadata/chef_11.4.2.json +2 -3
  40. data/chef_dsl_metadata/chef_11.4.4.json +2 -3
  41. data/chef_dsl_metadata/chef_11.6.0.json +9734 -0
  42. data/features/007_check_for_undeclared_recipe_dependencies.feature +18 -34
  43. data/features/017_check_for_no_lwrp_notifications.feature +25 -0
  44. data/features/019_check_for_consistent_node_access.feature +1 -0
  45. data/features/033_check_for_missing_template.feature +20 -64
  46. data/features/034_check_for_unused_template_variables.feature +44 -0
  47. data/features/047_check_for_attribute_assignment_without_precedence.feature +47 -0
  48. data/features/048_check_for_shellout.feature +34 -0
  49. data/features/049_check_for_role_name_mismatch_with_file_name.feature +31 -0
  50. data/features/050_check_for_invalid_name.feature +33 -0
  51. data/features/051_check_for_template_partial_loops.feature +21 -0
  52. data/features/command_line_help.feature +15 -0
  53. data/features/ignore_via_line_comments.feature +18 -0
  54. data/features/individual_file.feature +17 -1
  55. data/features/multiple_paths.feature +26 -2
  56. data/features/step_definitions/cookbook_steps.rb +328 -9
  57. data/features/support/command_helpers.rb +71 -10
  58. data/features/support/cookbook_helpers.rb +88 -6
  59. data/lib/foodcritic/api.rb +89 -20
  60. data/lib/foodcritic/command_line.rb +64 -18
  61. data/lib/foodcritic/domain.rb +26 -7
  62. data/lib/foodcritic/dsl.rb +3 -0
  63. data/lib/foodcritic/linter.rb +93 -61
  64. data/lib/foodcritic/rake_task.rb +3 -2
  65. data/lib/foodcritic/rules.rb +105 -14
  66. data/lib/foodcritic/template.rb +34 -1
  67. data/lib/foodcritic/version.rb +1 -1
  68. data/man/foodcritic.1 +13 -1
  69. data/man/foodcritic.1.ronn +9 -0
  70. data/spec/foodcritic/api_spec.rb +210 -1
  71. data/spec/foodcritic/command_line_spec.rb +13 -0
  72. data/spec/foodcritic/domain_spec.rb +40 -5
  73. data/spec/foodcritic/linter_spec.rb +19 -22
  74. data/spec/foodcritic/template_spec.rb +8 -4
  75. data/spec/regression/expected-output.txt +139 -60
  76. metadata +31 -26
checksums.yaml ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ NzZjYjgwYWQyMTcwZTMxYTlhODkyNjZjZjY4YmNkOGIyNmJmYzZkMA==
5
+ data.tar.gz: !binary |-
6
+ NjBhYTkxY2Q5MDFmNWM5NGQ0ZjhlZTk3NDY5ZGE2ZDg0MmQzYjA0Yg==
7
+ !binary "U0hBNTEy":
8
+ metadata.gz: !binary |-
9
+ ZDM2YTUwZWQ2YTQ5OTU4YTkzOTI2MGRhYmRmNDNmMDY0ZGRiZjMxMmY2MzQw
10
+ ODZjOWNhMDU0YWQ5OWY0MzQ2MDE4NDE1NGRmYTU0YTUxNmUwMDM1N2NmODYw
11
+ ODU3ZDI1NWJhZGJlMjIwYzg0NzFiY2FkY2YwMjYyNDMzZDY1OGU=
12
+ data.tar.gz: !binary |-
13
+ YmVhYjc2ZTQ5ZWFmNDZhODA2MTg4MTg3Nzc0OWY5ZGM4YzA4YWJlNTE4NGFi
14
+ YWVhMDU0NTQyMjJjZjBmNDVmOGFkNDk2ZmJkMTk2MTc5MWUxYTc3NmNkYTk4
15
+ YjQ0YzI4NDgwOTFhNmUxOTQyZGU3ZGQ3ZTRhZGMzY2IxNGMzZmM=
data/CHANGELOG.md CHANGED
@@ -1,3 +1,86 @@
1
+ ## 3.0.0 (14th September, 2013)
2
+
3
+ Features:
4
+
5
+ - [FC047: Attribute assignment does not specify precedence](http://foodcritic.io/#FC047)
6
+ rule added
7
+ ([related issue](https://github.com/acrmp/foodcritic/issues/81)). Thanks
8
+ @jtimberman, @miketheman.
9
+ - [FC048: Prefer Mixlib::ShellOut](http://foodcritic.io/#FC048)
10
+ rule added
11
+ ([related issue](https://github.com/acrmp/foodcritic/issues/111)). Thanks
12
+ @jaymzh.
13
+ - [FC049: Role name does not match containing file name](http://foodcritic.io/#FC049)
14
+ rule added
15
+ ([related issue](https://github.com/acrmp/foodcritic/issues/19)). Thanks
16
+ @jaymzh.
17
+ - [FC050: Name includes invalid characters](http://foodcritic.io/#FC050)
18
+ rule added.
19
+ - [FC051: Template partials loop indefinitely](http://foodcritic.io/#FC051)
20
+ rule added.
21
+ - Added support for checking Chef environment and role files
22
+ ([related issue](https://github.com/acrmp/foodcritic/issues/19)). Thanks
23
+ @jaymzh.
24
+ - Added metadata for Chef 11.6.0.
25
+ - API methods `#field`, `#field_value` and `#templates_included` added.
26
+ - The API now exposes access to whether individual warnings should be viewed
27
+ as failures
28
+ ([related issue](https://github.com/acrmp/foodcritic/issues/150)). Thanks
29
+ @jamesdburgess.
30
+
31
+ Bugfixes:
32
+
33
+ - [FC007: Ensure recipe dependencies are reflected in cookbook metadata](http://foodcritic.io/#FC007)
34
+ would warn if specifying dependencies in a multi-line word list with leading whitespace
35
+ ([related issue](https://github.com/acrmp/foodcritic/issues/160)). Thanks to
36
+ @philk for identifying and fixing this issue.
37
+ - [FC007: Ensure recipe dependencies are reflected in cookbook metadata](http://foodcritic.io/#FC007)
38
+ would not warn if `include_recipe` used parentheses
39
+ ([related issue](https://github.com/acrmp/foodcritic/issues/155)). Thanks
40
+ @jamesdburgess.
41
+ - [FC017: LWRP does not notify when updated](http://foodcritic.io/#FC017)
42
+ would warn even if `converge_by` or `use_inline_resources` was used
43
+ ([related issue](https://github.com/acrmp/foodcritic/issues/90)). Thanks
44
+ @stevendanna, @nevir.
45
+ - [FC017: LWRP does not notify when updated](http://foodcritic.io/#FC017)
46
+ would not warn if any action within the provider notified. Updated to report
47
+ against actions individually
48
+ ([related issue](https://github.com/acrmp/foodcritic/issues/90)).
49
+ - [FC019: Access node attributes in a consistent manner](http://foodcritic.io/#FC019)
50
+ would warn incorrectly against `node.run_state`
51
+ ([related issue](https://github.com/acrmp/foodcritic/issues/66)). Thanks
52
+ @jtimberman.
53
+ - [FC033: Missing template](http://foodcritic.io/#FC033)
54
+ would warn if the template filename began with a dot
55
+ ([related issue](https://github.com/acrmp/foodcritic/issues/165)). Thanks
56
+ @eherot.
57
+ - [FC034: Unused template variables](http://foodcritic.io/#FC034)
58
+ would warn incorrectly if variables were used by partials
59
+ ([related issue](https://github.com/acrmp/foodcritic/issues/140)). Thanks to
60
+ @v-a for implementing initial support for partials.
61
+ - [FC034: Unused template variables](http://foodcritic.io/#FC034)
62
+ would not be shown against inferred templates.
63
+ - [FC038: Invalid resource action](http://foodcritic.io/#FC038)
64
+ would warn incorrectly for log resources that specified a `write` action
65
+ ([related issue](https://github.com/acrmp/foodcritic/issues/154)). Thanks
66
+ @sethvargo.
67
+ - The foodcritic gem was missing a dependency on rake which broke
68
+ thor-foodcritic
69
+ ([related issue](https://github.com/acrmp/foodcritic/issues/157)). Thanks
70
+ @douglaswth.
71
+ - Template warnings should now be shown against the correct line number.
72
+ Previously warnings were always shown against line 1
73
+ ([related issue](https://github.com/acrmp/foodcritic/issues/102)). Thanks
74
+ @juliandunn.
75
+ - The `#declared_dependencies` API method could return duplicates for old
76
+ versions of LibXML.
77
+ ([related issue](https://github.com/acrmp/foodcritic/issues/163)). Thanks
78
+ @danleyden.
79
+
80
+ Other:
81
+
82
+ - This release introduces breaking changes to programmatic use of foodcritic.
83
+
1
84
  ## 2.2.0 (10th July, 2013)
2
85
 
3
86
  Features:
@@ -447,7 +447,8 @@
447
447
  "nothing"
448
448
  ],
449
449
  "log": [
450
- "nothing"
450
+ "nothing",
451
+ "write"
451
452
  ],
452
453
  "macports_package": [
453
454
  "install",
@@ -504,11 +505,9 @@
504
505
  "run"
505
506
  ],
506
507
  "remote_directory": [
507
- "create",
508
508
  "create",
509
509
  "create_if_missing",
510
510
  "delete",
511
- "delete",
512
511
  "nothing"
513
512
  ],
514
513
  "remote_file": [
@@ -464,7 +464,8 @@
464
464
  "nothing"
465
465
  ],
466
466
  "log": [
467
- "nothing"
467
+ "nothing",
468
+ "write"
468
469
  ],
469
470
  "macports_package": [
470
471
  "install",
@@ -525,11 +526,9 @@
525
526
  "run"
526
527
  ],
527
528
  "remote_directory": [
528
- "create",
529
529
  "create",
530
530
  "create_if_missing",
531
531
  "delete",
532
- "delete",
533
532
  "nothing"
534
533
  ],
535
534
  "remote_file": [
@@ -447,7 +447,8 @@
447
447
  "nothing"
448
448
  ],
449
449
  "log": [
450
- "nothing"
450
+ "nothing",
451
+ "write"
451
452
  ],
452
453
  "macports_package": [
453
454
  "install",
@@ -504,11 +505,9 @@
504
505
  "run"
505
506
  ],
506
507
  "remote_directory": [
507
- "create",
508
508
  "create",
509
509
  "create_if_missing",
510
510
  "delete",
511
- "delete",
512
511
  "nothing"
513
512
  ],
514
513
  "remote_file": [
@@ -447,7 +447,8 @@
447
447
  "nothing"
448
448
  ],
449
449
  "log": [
450
- "nothing"
450
+ "nothing",
451
+ "write"
451
452
  ],
452
453
  "macports_package": [
453
454
  "install",
@@ -504,11 +505,9 @@
504
505
  "run"
505
506
  ],
506
507
  "remote_directory": [
507
- "create",
508
508
  "create",
509
509
  "create_if_missing",
510
510
  "delete",
511
- "delete",
512
511
  "nothing"
513
512
  ],
514
513
  "remote_file": [
@@ -454,7 +454,8 @@
454
454
  "nothing"
455
455
  ],
456
456
  "log": [
457
- "nothing"
457
+ "nothing",
458
+ "write"
458
459
  ],
459
460
  "macports_package": [
460
461
  "install",
@@ -515,11 +516,9 @@
515
516
  "run"
516
517
  ],
517
518
  "remote_directory": [
518
- "create",
519
519
  "create",
520
520
  "create_if_missing",
521
521
  "delete",
522
- "delete",
523
522
  "nothing"
524
523
  ],
525
524
  "remote_file": [
@@ -454,7 +454,8 @@
454
454
  "nothing"
455
455
  ],
456
456
  "log": [
457
- "nothing"
457
+ "nothing",
458
+ "write"
458
459
  ],
459
460
  "macports_package": [
460
461
  "install",
@@ -515,11 +516,9 @@
515
516
  "run"
516
517
  ],
517
518
  "remote_directory": [
518
- "create",
519
519
  "create",
520
520
  "create_if_missing",
521
521
  "delete",
522
- "delete",
523
522
  "nothing"
524
523
  ],
525
524
  "remote_file": [
@@ -400,7 +400,8 @@
400
400
  "nothing"
401
401
  ],
402
402
  "log": [
403
- "nothing"
403
+ "nothing",
404
+ "write"
404
405
  ],
405
406
  "macports_package": [
406
407
  "install",
@@ -454,8 +455,6 @@
454
455
  ],
455
456
  "remote_directory": [
456
457
  "create",
457
- "create",
458
- "delete",
459
458
  "delete",
460
459
  "nothing"
461
460
  ],
@@ -400,7 +400,8 @@
400
400
  "nothing"
401
401
  ],
402
402
  "log": [
403
- "nothing"
403
+ "nothing",
404
+ "write"
404
405
  ],
405
406
  "macports_package": [
406
407
  "install",
@@ -454,8 +455,6 @@
454
455
  ],
455
456
  "remote_directory": [
456
457
  "create",
457
- "create",
458
- "delete",
459
458
  "delete",
460
459
  "nothing"
461
460
  ],
@@ -442,7 +442,8 @@
442
442
  "nothing"
443
443
  ],
444
444
  "log": [
445
- "nothing"
445
+ "nothing",
446
+ "write"
446
447
  ],
447
448
  "macports_package": [
448
449
  "install",
@@ -496,8 +497,6 @@
496
497
  ],
497
498
  "remote_directory": [
498
499
  "create",
499
- "create",
500
- "delete",
501
500
  "delete",
502
501
  "nothing"
503
502
  ],
@@ -446,7 +446,8 @@
446
446
  "nothing"
447
447
  ],
448
448
  "log": [
449
- "nothing"
449
+ "nothing",
450
+ "write"
450
451
  ],
451
452
  "macports_package": [
452
453
  "install",
@@ -503,11 +504,9 @@
503
504
  "run"
504
505
  ],
505
506
  "remote_directory": [
506
- "create",
507
507
  "create",
508
508
  "create_if_missing",
509
509
  "delete",
510
- "delete",
511
510
  "nothing"
512
511
  ],
513
512
  "remote_file": [
@@ -446,7 +446,8 @@
446
446
  "nothing"
447
447
  ],
448
448
  "log": [
449
- "nothing"
449
+ "nothing",
450
+ "write"
450
451
  ],
451
452
  "macports_package": [
452
453
  "install",
@@ -503,11 +504,9 @@
503
504
  "run"
504
505
  ],
505
506
  "remote_directory": [
506
- "create",
507
507
  "create",
508
508
  "create_if_missing",
509
509
  "delete",
510
- "delete",
511
510
  "nothing"
512
511
  ],
513
512
  "remote_file": [
@@ -448,7 +448,8 @@
448
448
  "nothing"
449
449
  ],
450
450
  "log": [
451
- "nothing"
451
+ "nothing",
452
+ "write"
452
453
  ],
453
454
  "macports_package": [
454
455
  "install",
@@ -505,11 +506,9 @@
505
506
  "run"
506
507
  ],
507
508
  "remote_directory": [
508
- "create",
509
509
  "create",
510
510
  "create_if_missing",
511
511
  "delete",
512
- "delete",
513
512
  "nothing"
514
513
  ],
515
514
  "remote_file": [
@@ -448,7 +448,8 @@
448
448
  "nothing"
449
449
  ],
450
450
  "log": [
451
- "nothing"
451
+ "nothing",
452
+ "write"
452
453
  ],
453
454
  "macports_package": [
454
455
  "install",
@@ -505,11 +506,9 @@
505
506
  "run"
506
507
  ],
507
508
  "remote_directory": [
508
- "create",
509
509
  "create",
510
510
  "create_if_missing",
511
511
  "delete",
512
- "delete",
513
512
  "nothing"
514
513
  ],
515
514
  "remote_file": [
@@ -448,7 +448,8 @@
448
448
  "nothing"
449
449
  ],
450
450
  "log": [
451
- "nothing"
451
+ "nothing",
452
+ "write"
452
453
  ],
453
454
  "macports_package": [
454
455
  "install",
@@ -505,11 +506,9 @@
505
506
  "run"
506
507
  ],
507
508
  "remote_directory": [
508
- "create",
509
509
  "create",
510
510
  "create_if_missing",
511
511
  "delete",
512
- "delete",
513
512
  "nothing"
514
513
  ],
515
514
  "remote_file": [
@@ -442,7 +442,8 @@
442
442
  "nothing"
443
443
  ],
444
444
  "log": [
445
- "nothing"
445
+ "nothing",
446
+ "write"
446
447
  ],
447
448
  "macports_package": [
448
449
  "install",
@@ -496,8 +497,6 @@
496
497
  ],
497
498
  "remote_directory": [
498
499
  "create",
499
- "create",
500
- "delete",
501
500
  "delete",
502
501
  "nothing"
503
502
  ],
@@ -442,7 +442,8 @@
442
442
  "nothing"
443
443
  ],
444
444
  "log": [
445
- "nothing"
445
+ "nothing",
446
+ "write"
446
447
  ],
447
448
  "macports_package": [
448
449
  "install",
@@ -496,8 +497,6 @@
496
497
  ],
497
498
  "remote_directory": [
498
499
  "create",
499
- "create",
500
- "delete",
501
500
  "delete",
502
501
  "nothing"
503
502
  ],