foodcritic 11.3.0 → 11.3.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: 88fc0b6609663a3130b05790fa5b002148959083
4
- data.tar.gz: 625351ee8459d8a682782e0afdd3588b055a608e
3
+ metadata.gz: 649c27ad1db9be0b804920d0787560a4a794b51c
4
+ data.tar.gz: 005c520265a530401ed166011f99c52b5e823025
5
5
  SHA512:
6
- metadata.gz: 417a8069b069de299e86ea247954d36da67a55846adee2e31f95ee96ca3d8c951b2d0726ce27f46c99838269d1dbf4b2685379a64291ed501275d613e3497741
7
- data.tar.gz: 93162e4cef27844a44bcf91d3b96cfb4d3b7cc2d4205deb3f2218aa07fd3aa5bcf2d3abd5f5de0da533fcb250b2c822390b52bbc74fb5c049d898688cd846af1
6
+ metadata.gz: 6913668004c53199adb982b16831e5655d89dbd4fef72abc192c02b9269530776e9018b6ccd4a8d2b7d49deea1b7a53da9a18f9f36aac4033a29f49e439cdde9
7
+ data.tar.gz: 394d84b9f65477ec27eb564c0857859d973b4570120175390420efcef40cac6824a60ce707a106d456bef4fb052d10ee011a93eb88d2f06194d657f82551ca05
@@ -1,5 +1,11 @@
1
1
  # Foodcritic Changelog:
2
2
 
3
+ ## [11.3.1](https://github.com/Foodcritic/foodcritic/tree/v11.3.1) (2017-08-17)
4
+
5
+ **Fixed bugs:**
6
+
7
+ - Allow EncryptedDataBagItem.load_secret in FC086
8
+
3
9
  ## [11.3.0](https://github.com/Foodcritic/foodcritic/tree/v11.3.0) (2017-07-12)
4
10
 
5
11
  [Full Changelog](https://github.com/Foodcritic/foodcritic/compare/v11.2.0...v11.3.0)
@@ -1,7 +1,7 @@
1
1
  rule "FC086", "Use databag helper methods to load data bag items" do
2
2
  tags %w{style}
3
3
  def old_dbag(ast)
4
- ast.xpath('//const_path_ref/const[@value="EncryptedDataBagItem" or @value="DataBagItem"]/..//const[@value="Chef"]/../../..')
4
+ ast.xpath('//const_path_ref/const[@value="EncryptedDataBagItem" or @value="DataBagItem"]/..//const[@value="Chef"]/../../..//ident[@value!="load_secret"]/..')
5
5
  end
6
6
 
7
7
  resource { |ast| old_dbag(ast) }
@@ -1,4 +1,4 @@
1
1
  module FoodCritic
2
2
  # The current version of foodcritic
3
- VERSION = "11.3.0"
3
+ VERSION = "11.3.1"
4
4
  end
@@ -1,17 +1,17 @@
1
1
  require "spec_helper"
2
2
 
3
3
  describe "FC086" do
4
- context "with a cookbook with a recipe that uses Chef::EncryptedDataBagItem.load_secret" do
4
+ context "with a recipe that uses Chef::EncryptedDataBagItem.load" do
5
5
  recipe_file 'Chef::EncryptedDataBagItem.load("users", "tsmith", key)'
6
6
  it { is_expected.to violate_rule }
7
7
  end
8
8
 
9
- context "with a cookbook with a recipe that uses Chef::DataBagItem.load" do
9
+ context "with a recipe that uses Chef::DataBagItem.load" do
10
10
  recipe_file 'Chef::DataBagItem.load("users", "tsmith")'
11
11
  it { is_expected.to violate_rule }
12
12
  end
13
13
 
14
- context "with a cookbook with a resource that uses Chef::EncryptedDataBagItem.load_secret" do
14
+ context "with a resource that uses Chef::EncryptedDataBagItem.load" do
15
15
  resource_file <<-EOF
16
16
  action :create do
17
17
  data = Chef::EncryptedDataBagItem.load("users", "tsmith", key)
@@ -20,7 +20,7 @@ describe "FC086" do
20
20
  it { is_expected.to violate_rule }
21
21
  end
22
22
 
23
- context "with a cookbook with a resource that uses Chef::EncryptedDataBagItem.load_secret" do
23
+ context "with a resource that uses Chef::DataBagItem.load" do
24
24
  resource_file <<-EOF
25
25
  action :create do
26
26
  data = Chef::DataBagItem.load("users", "tsmith")
@@ -29,8 +29,13 @@ describe "FC086" do
29
29
  it { is_expected.to violate_rule }
30
30
  end
31
31
 
32
- context "with a cookbook with a resource that uses data_bag_item" do
33
- recipe_file "data_bag_item('bag', 'item', IO.read('secret_file'))"
32
+ context "with a recipe that uses data_bag_item" do
33
+ recipe_file "data_bag_item('bag', 'item', IO.read('secret_file').strip)"
34
+ it { is_expected.not_to violate_rule }
35
+ end
36
+
37
+ context "with a recipe that uses Chef::EncryptedDataBagItem.load_secret" do
38
+ recipe_file "data_bag_item('bag', 'item', Chef::EncryptedDataBagItem.load_secret('secret_file'))"
34
39
  it { is_expected.not_to violate_rule }
35
40
  end
36
41
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foodcritic
3
3
  version: !ruby/object:Gem::Version
4
- version: 11.3.0
4
+ version: 11.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Crump
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-07-12 00:00:00.000000000 Z
11
+ date: 2017-08-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cucumber-core
@@ -505,8 +505,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
505
505
  version: '0'
506
506
  requirements: []
507
507
  rubyforge_project:
508
- rubygems_version: 2.6.12
508
+ rubygems_version: 2.6.11
509
509
  signing_key:
510
510
  specification_version: 4
511
- summary: foodcritic-11.3.0
511
+ summary: foodcritic-11.3.1
512
512
  test_files: []