puppet-lint-resource_reference_syntax 1.0.1 → 1.0.2
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: 73c7049c068ecde592b71eb2cfbc542a4f0bd55d
|
4
|
+
data.tar.gz: c7b2fd27e59671362db4f8e13fa59cdbca9aea9f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ef016a2d6ad6992a427d7219cbdc3c70444498c70547f7367800c2b70f9907e4ef40c143b53034cecbd090f04ca9495e930f20a5c558beb2ab51bca9708f2414
|
7
|
+
data.tar.gz: 67282c88a86427cd528de11d11b53b5de1fbb5def830646e5970f2a39aed76ad99b91681000284f1422777f021f72b996b795800ba9d496beba06a6433319df7
|
data/README.md
CHANGED
@@ -31,7 +31,7 @@ ERROR: whitespce between reference type and title on line 4
|
|
31
31
|
|
32
32
|
**--fix support: No**
|
33
33
|
|
34
|
-
This check will raise an error for any resource reference that uses the title with capital letter.
|
34
|
+
This check will raise an error for any resource reference that uses the title with capital letter without enclosed quotes.
|
35
35
|
|
36
36
|
```
|
37
37
|
ERROR: resource reference with title with capital letter on line 4
|
@@ -4,13 +4,15 @@ PuppetLint.new_check(:resource_reference_without_title_capital) do
|
|
4
4
|
resource[:param_tokens].select { |param_token|
|
5
5
|
['require', 'subscribe', 'notify', 'before'].include? param_token.value
|
6
6
|
}.each do |param_token|
|
7
|
-
value_token = param_token.next_code_token.next_code_token.next_code_token.
|
8
|
-
unless value_token.
|
9
|
-
|
10
|
-
:
|
11
|
-
|
12
|
-
|
13
|
-
|
7
|
+
value_token = param_token.next_code_token.next_code_token.next_code_token.next_token
|
8
|
+
unless value_token.type == :SSTRING
|
9
|
+
unless value_token.value =~ (/^[a-z]*$/)
|
10
|
+
notify :error, {
|
11
|
+
:message => 'resource reference with title with capital letter',
|
12
|
+
:line => value_token.line,
|
13
|
+
:column => value_token.column
|
14
|
+
}
|
15
|
+
end
|
14
16
|
end
|
15
17
|
end
|
16
18
|
end
|
@@ -11,6 +11,15 @@ describe 'resource_reference_without_title_capital' do
|
|
11
11
|
end
|
12
12
|
end
|
13
13
|
|
14
|
+
context 'a proper reference in quotes' do
|
15
|
+
let(:msg) { 'whitespce between reference type and title' }
|
16
|
+
let(:code) { "file { 'foo': ensure => file, notify => Title['One'],}" }
|
17
|
+
|
18
|
+
it 'should detect no problem' do
|
19
|
+
expect(problems).to have(0).problem
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
14
23
|
context 'resource reference with title as capital letter' do
|
15
24
|
let(:msg) { 'resource reference with title with capital letter' }
|
16
25
|
let(:code) { "file { 'foo': ensure => file, notify => Title[One],}" }
|
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.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Martin Alfke
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-10-
|
11
|
+
date: 2015-10-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: puppet-lint
|