cookstyle 6.16.7 → 6.16.9

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: 478785b2c4e9672c7a684b3612420b4cff2191d7711238f9daa45e2b0a8b02d8
4
- data.tar.gz: 6d2af42693cfa0f26cba72cdd6d0dc05ef5c1069f3573a22a0b4a2441564529d
3
+ metadata.gz: a8e68daec28420e78dc490431b8d537e9f0ed6d1584169ac3a38ec5d5b299d74
4
+ data.tar.gz: 748af99f0eca7196d254d8f780185e7bca2dbe7e6be2fa7442b2974f083c2db3
5
5
  SHA512:
6
- metadata.gz: 7870c3d596adc50c7f6c6fd377513629ec373cb56b972115bb31887dbd38122730f0461fa03e86ae73598a3385d95413a760ece7128325e568f3b423afba2dd0
7
- data.tar.gz: bbae89086e0358c8fcbc6e6eaabfe4f581954334be3983039720a025729750ef2acb1c772df5e00441fc1d0bc4f59a84217a4ea51dc758e5f46e02d1dac7bd9d
6
+ metadata.gz: fa5506a626d47605585b6d1d94a2eb4c1e8d2f5cd34ee85823beb240f4b3983f249bfe9abbd692a7905ecb939eea59e5ebfed61410c6bb93c9416b1c2d9df6da
7
+ data.tar.gz: 2b49fd42843f06262d32690695f3e02ed86fe80d67fcc03f1c2abaf1fd8d3cba7751eabb9f1b35fd07efbd44f026f5ae1d18c5c00597b2516e59dcb6916920e3
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
  module Cookstyle
3
- VERSION = "6.16.7" # rubocop: disable Style/StringLiterals
3
+ VERSION = "6.16.9" # rubocop: disable Style/StringLiterals
4
4
  RUBOCOP_VERSION = '0.90.0'
5
5
  end
@@ -33,11 +33,12 @@ module RuboCop
33
33
  #
34
34
  class ResourceOverridesProvidesMethod < Base
35
35
  MSG = "Don't override the provides? method in a resource provider. Use provides :SOME_PROVIDER_NAME instead. This will cause failures in Chef Infra Client 13 and later."
36
- RESTRICT_ON_SEND = [:provides?].freeze
37
36
 
38
37
  def_node_search :provides, '(send nil? :provides ...)'
39
38
 
40
39
  def on_def(node)
40
+ return unless node.method_name == :provides?
41
+
41
42
  add_offense(node, message: MSG, severity: :warning) if provides(processed_source.ast).count == 0
42
43
  end
43
44
  end
@@ -44,6 +44,9 @@ module RuboCop
44
44
  PATTERN
45
45
 
46
46
  def on_send(node)
47
+ # avoid triggering on things like new_resource.actions
48
+ return unless node.receiver.nil?
49
+
47
50
  # if the resource requires poise then bail out since we're in a poise resource where @allowed_actions is legit
48
51
  return if poise_require(processed_source.ast).any? || !resource_actions?(processed_source.ast)
49
52
 
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: 6.16.7
4
+ version: 6.16.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thom May