puppet-lint-absolute_classname-check 0.2.2 → 0.2.4
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,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MWFlMTZkOGE3NDQ2YTBhNTEzZmFmMWM2YTRmNTQ1ZjRiOTgzNTUzYw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YmM5MDcwNjFhOTNjNmQ3NTczYThkZmRkZTE4Y2IwZTE3Y2IwODczYw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YmQ0ZDU3MGU4Y2JlY2E5OTZmMzhmNDg0MWE5ZjZmMDVjNGQzMDEzOGJkMTZm
|
10
|
+
ZjkxNWZhM2IzY2ZjNzQ3OGNkYjk0ZGUyODUwYjc0YjJhN2I3MDVlZmQ4ZDVh
|
11
|
+
MjkxNGFjMTM1MjhjNmUyODdmZmMxZGE5YzM2YTliZjllMjdkNDE=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NzcwMWVmODk1NzE4Y2NlZTQ4ODY0YWFlNTBhZDExZDlkMjA5NWZkYmFkYWI0
|
14
|
+
MGQxOWU5NWEzZDA1YTU1Njc2MDk2ZDQ0NGVhZGE4MTZjYzczMTRlOWQzN2Fm
|
15
|
+
MmE5MDU5YmFjOTc1MWZhZmJhOTc2NmU0YThhNTAwZDI3OWJhM2Q=
|
@@ -2,8 +2,8 @@ PuppetLint.new_check(:relative_classname_inclusion) do
|
|
2
2
|
def check
|
3
3
|
tokens.each_with_index do |token, token_idx|
|
4
4
|
if token.type == :NAME && ['include','contain','require'].include?(token.value)
|
5
|
-
next if resource_indexes.any? { |resource| resource[:tokens].include?(token) }
|
6
5
|
s = token.next_code_token
|
6
|
+
next if s.type == :FARROW
|
7
7
|
in_function = 0
|
8
8
|
while s.type != :NEWLINE
|
9
9
|
n = s.next_code_token
|
@@ -79,6 +79,23 @@ describe 'relative_classname_inclusion' do
|
|
79
79
|
expect(problems).to have(0).problems
|
80
80
|
end
|
81
81
|
end
|
82
|
+
|
83
|
+
context 'when require is a hash key' do
|
84
|
+
let(:code) do
|
85
|
+
<<-EOS
|
86
|
+
$defaults = {
|
87
|
+
require => Exec['apt_update'],
|
88
|
+
}
|
89
|
+
$defaults = {
|
90
|
+
'require' => Exec['apt_update'],
|
91
|
+
}
|
92
|
+
EOS
|
93
|
+
end
|
94
|
+
|
95
|
+
it 'should detect no problems' do
|
96
|
+
expect(problems).to have(0).problems
|
97
|
+
end
|
98
|
+
end
|
82
99
|
end
|
83
100
|
|
84
101
|
context 'with fix enabled' do
|