puppet-lint-resource_reference_syntax 1.0.7 → 1.0.8
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e6b2254b49b906dcf615a464af0f38d287b95db3
|
4
|
+
data.tar.gz: 4bd200188d28bb2c13ae0f99257fd51c7cf240a6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0347e5725134c0fec66d28dd0e8f496979066319beae838dd4fc74ab18a06ea7978dec52d2444f98aaf0801a3b63e015b34d2dbaaf1c95be1495bf17df7f4870
|
7
|
+
data.tar.gz: 58cb18993fe39689ca82c5252565a6867129ed0488eb597264b58a1b1c34373e30aec15943c09624463d4060b3e8c6344f6bcbe56bcaecf7ad4399473d722027
|
@@ -4,15 +4,32 @@ PuppetLint.new_check(:resource_reference_without_title_capital) do
|
|
4
4
|
resource[:param_tokens].select { |param_token|
|
5
5
|
['require', 'subscribe', 'notify', 'before', 'consume', 'export'].include? param_token.value
|
6
6
|
}.each do |param_token|
|
7
|
-
value_token = param_token.next_code_token
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
7
|
+
value_token = param_token.next_code_token
|
8
|
+
check = value_token.next_token
|
9
|
+
until check.nil?
|
10
|
+
case value_token.next_token.type
|
11
|
+
when :CLASSREF
|
12
|
+
begin
|
13
|
+
if value_token.next_token.next_token.type == :LBRACK
|
14
|
+
check_token = value_token.next_token.next_token.next_token
|
15
|
+
if check_token.type == :CLASSREF or check_token.type == :NAME
|
16
|
+
notify :error, {
|
17
|
+
:message => 'resource reference with title with capital letter',
|
18
|
+
:line => check_token.line,
|
19
|
+
:column => check_token.column
|
20
|
+
}
|
21
|
+
end
|
22
|
+
end
|
23
|
+
value_token = value_token.next_token
|
24
|
+
check = value_token.next_token
|
25
|
+
end
|
26
|
+
else
|
27
|
+
value_token = value_token.next_token
|
28
|
+
check = value_token.next_token
|
29
|
+
end
|
14
30
|
end
|
15
31
|
end
|
16
32
|
end
|
17
33
|
end
|
18
34
|
end
|
35
|
+
|
@@ -13,8 +13,8 @@ PuppetLint.new_check(:resource_reference_without_whitespace) do
|
|
13
13
|
if value_token.next_token.next_token.type == :WHITESPACE
|
14
14
|
notify :error, {
|
15
15
|
:message => 'whitespce between reference type and title',
|
16
|
-
:line =>
|
17
|
-
:column =>
|
16
|
+
:line => value_token.next_token.next_token.line,
|
17
|
+
:column => value_token.next_token.next_token.column
|
18
18
|
}
|
19
19
|
end
|
20
20
|
value_token = value_token.next_token
|
@@ -78,7 +78,7 @@ describe 'resource_reference_without_title_capital' do
|
|
78
78
|
let(:code) { "file { 'foo': ensure => file, notify => Title[One, Two],}" }
|
79
79
|
|
80
80
|
it 'should only detect a single problem' do
|
81
|
-
expect(problems)
|
81
|
+
expect(problems)
|
82
82
|
end
|
83
83
|
|
84
84
|
it 'should create an error' do
|
@@ -91,7 +91,7 @@ describe 'resource_reference_without_title_capital' do
|
|
91
91
|
let(:code) { "file { 'foo': ensure => file, notify => [Title[One], Title[Two],]}" }
|
92
92
|
|
93
93
|
it 'should only detect a single problem' do
|
94
|
-
expect(problems)
|
94
|
+
expect(problems)
|
95
95
|
end
|
96
96
|
|
97
97
|
it 'should create an error' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: puppet-lint-resource_reference_syntax
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Martin Alfke
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-03-
|
11
|
+
date: 2016-03-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: puppet-lint
|