puppet-lint-module_reference-check 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2adc6115f3e7f9a1501f7e8f5a123f1058cf1d5ef8b20894617e4b1959ce6fcc
|
4
|
+
data.tar.gz: b4ff6aa3967cb954f245704b3dde86203146b3d8e569de41b318af1aaa53d950
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5a3c5a95e0c14cb4bd6eb12497c79e76d5b71bb94437ae16301f458db6bf300675deb2f40aa31959fba84f2d5a0b8d74264a200660566d5f9ccdf8d77404ed6a
|
7
|
+
data.tar.gz: faf782c5114458182a9e5746c6d46c2b66dd15467dcc83f6bdd7dae886c67de50c2dffb3c0371de364538ceb7913bfcbbfcf110dd4815274beb1d9831c9bf243
|
@@ -53,7 +53,7 @@ class Reference
|
|
53
53
|
feature_includes = []
|
54
54
|
tokens.reject { |token| %i[WHITESPACE NEWLINE INDENT].include? token.type }.each do |token|
|
55
55
|
@current_token = token
|
56
|
-
@workflow.got_include if token.value == 'include'
|
56
|
+
@workflow.got_include if token.type == :NAME && token.value == 'include' && token.next_code_token&.type == :NAME
|
57
57
|
@workflow.got_class if token.value == 'class'
|
58
58
|
@workflow.got_features_start if token.value == 'role::include_features'
|
59
59
|
@workflow.got_feature if token.type == :LBRACK && @workflow.current == :awaiting_feature
|
@@ -59,6 +59,23 @@ describe 'module_reference' do
|
|
59
59
|
end
|
60
60
|
end
|
61
61
|
|
62
|
+
context 'valid code with using include in a different context' do
|
63
|
+
let(:code) do
|
64
|
+
<<~CODE
|
65
|
+
class test () {
|
66
|
+
$a = {
|
67
|
+
include => 'something'
|
68
|
+
}
|
69
|
+
$a.reduce({})
|
70
|
+
}
|
71
|
+
CODE
|
72
|
+
end
|
73
|
+
|
74
|
+
it 'should detect detect any problems' do
|
75
|
+
expect(problems).to have(0).problems
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
62
79
|
context 'code with missing internal link' do
|
63
80
|
let(:code) do
|
64
81
|
<<~CODE
|