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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a8e68daec28420e78dc490431b8d537e9f0ed6d1584169ac3a38ec5d5b299d74
|
4
|
+
data.tar.gz: 748af99f0eca7196d254d8f780185e7bca2dbe7e6be2fa7442b2974f083c2db3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fa5506a626d47605585b6d1d94a2eb4c1e8d2f5cd34ee85823beb240f4b3983f249bfe9abbd692a7905ecb939eea59e5ebfed61410c6bb93c9416b1c2d9df6da
|
7
|
+
data.tar.gz: 2b49fd42843f06262d32690695f3e02ed86fe80d67fcc03f1c2abaf1fd8d3cba7751eabb9f1b35fd07efbd44f026f5ae1d18c5c00597b2516e59dcb6916920e3
|
data/lib/cookstyle/version.rb
CHANGED
@@ -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
|
|