cookstyle 5.6.2 → 5.6.5

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
  SHA256:
3
- metadata.gz: b1802f69a48b5c25b599199ac6e97ebd036bc1c92a6e33653700ddcd48565f6e
4
- data.tar.gz: 12ce2bf3e7d4b3e2cf254bfe9fad557eb7c077ae52c2572f9262fca194048d90
3
+ metadata.gz: ffca3b8387e0818808debc42526209312332b497559ed017b37f772187bca663
4
+ data.tar.gz: 769bbde3f4becf66b92311d728b7d2b5d14924d18c2ebe4a77cc31c6bc95fbf0
5
5
  SHA512:
6
- metadata.gz: bd1ab13eecd20c9bf2777d46da546f880a3f94cf2d0411a36ebdc7e5117974bf534489619e87cfc0eeafb26ae14d406c82f497b022054464ef440fb4068c69c3
7
- data.tar.gz: 1cb23f278d044fc0acd6b818a94664e0c078aeeba78a639a9ade4fbadb5065addf62454fa78d31beed80209d11ecc9a54af3182223a233439b19a15210c1c63d
6
+ metadata.gz: 59ec17831658cb6712d866f71af9d1dcb59c2f81f98760f5966394cdf6e22c6e0b580a2e2cb8e069486d401dfdef7e0595769fd4c117c3d074270b72a7e2c8d5
7
+ data.tar.gz: 8f062dd18cdb2e65b96285d5683397229109369db6f7d562af7e0d0ac61133cdbda34205ae340e37c5bc2589c8c8de7044204ab9625c45153e8d0df25d4ebf77
data/Gemfile CHANGED
@@ -23,9 +23,3 @@ group :development do
23
23
  gem 'rspec', '>= 3.4'
24
24
  gem 'simplecov'
25
25
  end
26
-
27
- instance_eval(ENV['GEMFILE_MOD']) if ENV['GEMFILE_MOD']
28
-
29
- # If you want to load debugging tools into the bundle exec sandbox,
30
- # add these additional dependencies into Gemfile.local
31
- eval_gemfile(__FILE__ + '.local') if File.exist?(__FILE__ + '.local')
@@ -626,7 +626,7 @@ ChefModernize/OpensslRsaKeyResource:
626
626
  - '**/metadata.rb'
627
627
 
628
628
  ChefModernize/OpensslX509Resource:
629
- Description: The openssl_x509 resource was renamed to openssl_x509_certificate. The new resource name should be used.
629
+ Description: The openssl_x509 resource was renamed to openssl_x509_certificate in Chef Infra Client 14.4. The new resource name should be used.
630
630
  Enabled: true
631
631
  VersionAdded: '5.6.0'
632
632
  Exclude:
@@ -1,4 +1,4 @@
1
1
  module Cookstyle
2
- VERSION = "5.6.2".freeze # rubocop: disable Style/StringLiterals
2
+ VERSION = "5.6.5".freeze # rubocop: disable Style/StringLiterals
3
3
  RUBOCOP_VERSION = '0.72.0'.freeze
4
4
  end
@@ -28,6 +28,8 @@ module RuboCop
28
28
  #
29
29
 
30
30
  class LongDescriptionMetadata < Cop
31
+ include RangeHelp
32
+
31
33
  MSG = 'The long_description metadata.rb method is not used and is unnecessary in cookbooks'.freeze
32
34
 
33
35
  def_node_matcher :long_description?, <<-PATTERN
@@ -42,7 +44,7 @@ module RuboCop
42
44
 
43
45
  def autocorrect(node)
44
46
  lambda do |corrector|
45
- corrector.remove(node.loc.expression)
47
+ corrector.remove(range_with_surrounding_space(range: node.loc.expression, side: :right))
46
48
  end
47
49
  end
48
50
  end
@@ -18,7 +18,7 @@ module RuboCop
18
18
  module Cop
19
19
  module Chef
20
20
  module ChefModernize
21
- # The openssl_x509 resource was renamed to openssl_x509_certificate.
21
+ # The openssl_x509 resource was renamed to openssl_x509_certificate in Chef Infra Client 14.4.
22
22
  # The new resource name should be used.
23
23
  #
24
24
  # # bad
@@ -40,7 +40,7 @@ module RuboCop
40
40
  class OpensslX509Resource < Cop
41
41
  include RuboCop::Chef::CookbookHelpers
42
42
 
43
- MSG = 'The openssl_x509 resource was renamed to openssl_x509_certificate. The new resource name should be used.'.freeze
43
+ MSG = 'The openssl_x509 resource was renamed to openssl_x509_certificate in Chef Infra Client 14.4. The new resource name should be used.'.freeze
44
44
 
45
45
  def on_send(node)
46
46
  add_offense(node, location: :expression, message: MSG, severity: :refactor) if node.method_name == :openssl_x509
@@ -38,18 +38,16 @@ module RuboCop
38
38
  PATTERN
39
39
 
40
40
  def on_send(node)
41
- platform_check?(node) do |type, plat|
42
- # set these so we can use them in the auto_correct method
43
- @type = type
44
- @plat = plat
45
-
41
+ platform_check?(node) do
46
42
  add_offense(node, location: :expression, message: MSG, severity: :refactor)
47
43
  end
48
44
  end
49
45
 
50
46
  def autocorrect(node)
51
47
  lambda do |corrector|
52
- corrector.replace(node.loc.expression, "#{@type.value}?('#{@plat.value}')")
48
+ platform_check?(node) do |type, plat|
49
+ corrector.replace(node.loc.expression, "#{type.value}?('#{plat.value}')")
50
+ end
53
51
  end
54
52
  end
55
53
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cookstyle
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.6.2
4
+ version: 5.6.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thom May
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2019-09-11 00:00:00.000000000 Z
12
+ date: 2019-10-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake