foodcritic 10.1.0 → 10.1.1

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
2
  SHA1:
3
- metadata.gz: d13edaa29dc5980c6783c28bdfa72c6ae5624ecd
4
- data.tar.gz: 95e285806cc9168efa32ab6e1511e291bff66e3e
3
+ metadata.gz: bf1400039591c18cb681dc2add6b181ea08cd506
4
+ data.tar.gz: a54e351dc350f646a429ec9a266c4d67f09979d0
5
5
  SHA512:
6
- metadata.gz: b1d7d8da69d8092724ccc970aa9a236175af58bb2c76a77582e6792ae3732efc924b98496faefecc3f02be8ce8315f61a412f2b71e80916c066956a1e7f5b5e9
7
- data.tar.gz: 22c4676382a67e8c685af190bd473f22cdb161397e84479f4fa76666e4f89fff60d64fc88d121e808d3bbf9a32aea9fa754a79f9232abe08553afc42bd9b8112
6
+ metadata.gz: 7fc6031eb6d2c0a25d59871f9412decb490e455a2e0be5617c6473ab7c32a0642005023da4918cb55c03d02399b413bf8327ba68528dc9a88c908292f270e728
7
+ data.tar.gz: 9d9f373826b4e3996dfd41a7a0227210bc8ab601668a8eef96eeda39bac179752b59bcc8e7fae3dbe9d956c385707138593573ec3026cfa416400899fac91e3a
data/CHANGELOG.md CHANGED
@@ -1,7 +1,13 @@
1
1
  # Foodcritic Changelog:
2
2
 
3
- ## [10.1.0](https://github.com/acrmp/foodcritic/tree/10.1.0) (2017-03-29)
3
+ ## [10.1.1](https://github.com/acrmp/foodcritic/tree/v10.1.1) (2017-03-29)
4
+ [Full Changelog](https://github.com/acrmp/foodcritic/compare/v10.1.0...v10.1.1)
4
5
 
6
+ **Fixed bugs:**
7
+
8
+ - Fix FC016 triggering on custom resources [\#525](https://github.com/acrmp/foodcritic/pull/525) ([tas50](https://github.com/tas50))
9
+
10
+ ## [v10.1.0](https://github.com/acrmp/foodcritic/tree/v10.1.0) (2017-03-29)
5
11
  [Full Changelog](https://github.com/acrmp/foodcritic/compare/v10.0.0...v10.1.0)
6
12
 
7
13
  **Implemented enhancements:**
@@ -18,3 +18,8 @@ Feature: Check for no LWRP default action
18
18
  Given a cookbook that contains a LWRP with a default action defined via a constructor
19
19
  When I check the cookbook
20
20
  Then the LWRP has no default action warning 016 should not be displayed against the resource file
21
+
22
+ Scenario: Custom resource with no default action
23
+ Given a cookbook that contains a custom resource with no default action
24
+ When I check the cookbook
25
+ Then the LWRP has no default action warning 016 should not be displayed against the resource file
@@ -984,6 +984,10 @@ Given /^a cookbook that contains a LWRP with (no|a) default action( defined via
984
984
  :notifies => :does_notify })
985
985
  end
986
986
 
987
+ Given "a cookbook that contains a custom resource with no default action" do
988
+ cookbook_with_custom_resource
989
+ end
990
+
987
991
  Given "a cookbook that contains no ruby blocks" do
988
992
  write_recipe %q{
989
993
  package "tar" do
@@ -94,6 +94,27 @@ module FoodCritic
94
94
  }.strip)
95
95
  end
96
96
 
97
+ # Create a cookbook with a custom resource
98
+ #
99
+ # @author Tim Smith - tsmith@chef.io
100
+ # @since 10.1.1
101
+ def cookbook_with_custom_resource
102
+ write_resource("site", %Q{
103
+ property :name, String, name_property: true
104
+ property :variables, Hash, default: {}
105
+
106
+ action :create do
107
+ log "Here is where I would create a " + thing
108
+ end
109
+
110
+ action_class do
111
+ def thing
112
+ return "site"
113
+ end
114
+ end
115
+ })
116
+ end
117
+
97
118
  # Create a cookbook with a LRWP
98
119
  #
99
120
  # @param [Hash] lwrp The options to use for the created LWRP
@@ -85,7 +85,7 @@ module FoodCritic
85
85
  # The absolute path of a cookbook from the specified file.
86
86
  #
87
87
  # @author Tim Smith - tsmith@chef.io
88
- # @since 11.0
88
+ # @since 10.1
89
89
  # @param file [String, Pathname] relative or absolute path to a file in the cookbook
90
90
  # @return [String] the absolute path to the base of the cookbook
91
91
  def cookbook_base_path(file)
@@ -1,6 +1,8 @@
1
1
  rule "FC016", "LWRP does not declare a default action" do
2
2
  tags %w{correctness lwrp}
3
3
  resource do |ast, filename|
4
+ # See if we're in a custom resource not an LWRP. Only LWRPs need the default_action
5
+ next if ast.xpath("//ident/@value='property'")
4
6
  unless ["//ident/@value='default_action'",
5
7
  "//def/bodystmt/descendant::assign/
6
8
  var_field/ivar/@value='@action'"].any? { |expr| ast.xpath(expr) }
@@ -1,4 +1,4 @@
1
1
  module FoodCritic
2
2
  # The current version of foodcritic
3
- VERSION = "10.1.0"
3
+ VERSION = "10.1.1"
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foodcritic
3
3
  version: !ruby/object:Gem::Version
4
- version: 10.1.0
4
+ version: 10.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Crump
@@ -355,5 +355,5 @@ rubyforge_project:
355
355
  rubygems_version: 2.6.11
356
356
  signing_key:
357
357
  specification_version: 4
358
- summary: foodcritic-10.1.0
358
+ summary: foodcritic-10.1.1
359
359
  test_files: []