puppet-lint-resource_reference_syntax 1.0.13 → 1.0.14
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b4d49d1c29ba9ae2d623b28608f0830ed9ad519d
|
4
|
+
data.tar.gz: 05917862e5e238a57adb9ea389f8c5a3e4a15261
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2d534ade50b6749f69bd0dd3e479e6e267ddae29f825ac22428b8a2767d6d9d9392ac825acd179fa66cfc9f69c8efe1d569b6997f85251a1ce2344cf2a971f92
|
7
|
+
data.tar.gz: c3b6eef005b06ba8c833555b3a8117fabe0dc68a0da9cecbb4f9c330116ff9a078535f83f8e2f51ad5466ac897d23af4ddcec159a1dfad7a46709705b3947661
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# Check for Class references
|
2
|
+
PuppetLint.new_check(:resource_reference_chain_without_whitespace) do
|
3
|
+
def check
|
4
|
+
tokens.select { |token|
|
5
|
+
[:TYPE].include? token.type
|
6
|
+
}.each do |param_token|
|
7
|
+
check = param_token
|
8
|
+
case check.type
|
9
|
+
when :TYPE
|
10
|
+
begin
|
11
|
+
if check.next_token.type == :WHITESPACE and check.next_code_token.type == :LBRACK
|
12
|
+
notify :error, {
|
13
|
+
:message => 'whitespce between reference type and title',
|
14
|
+
:line => check.line,
|
15
|
+
:column => check.column
|
16
|
+
}
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe 'resource_reference_chain_without_whitespace' do
|
4
|
+
|
5
|
+
context 'a whitespace between reference and bracket on chains' do
|
6
|
+
let(:msg) { 'whitespce between reference type and title' }
|
7
|
+
let(:code) { "class foo { include foo::install include foo::config include foo::service Class ['foo::install'] -> Class ['foo::config'] ~> Class ['foo::service'] } " }
|
8
|
+
|
9
|
+
it 'should detect two problems' do
|
10
|
+
expect(problems).to have(3).problem
|
11
|
+
end
|
12
|
+
|
13
|
+
it 'should create an error' do
|
14
|
+
expect(problems).to contain_error(msg).on_line(1)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
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.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Martin Alfke
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-01-
|
11
|
+
date: 2018-01-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: puppet-lint
|
@@ -110,12 +110,14 @@ files:
|
|
110
110
|
- ".rspec"
|
111
111
|
- LICENSE
|
112
112
|
- README.md
|
113
|
+
- lib/puppet-lint/plugins/resource_reference_chain_without_whitespace.rb
|
113
114
|
- lib/puppet-lint/plugins/resource_reference_without_title_capital.rb
|
114
115
|
- lib/puppet-lint/plugins/resource_reference_without_whitespace.rb
|
116
|
+
- spec/puppet-lint/plugins/resource_reference_chain_without_whitespace_spec.rb
|
115
117
|
- spec/puppet-lint/plugins/resource_reference_without_title_capital_spec.rb
|
116
118
|
- spec/puppet-lint/plugins/resource_reference_without_whitespace_spec.rb
|
117
119
|
- spec/spec_helper.rb
|
118
|
-
homepage: https://github.com/
|
120
|
+
homepage: https://github.com/voxpupuli/puppet-lint-resource_reference_syntax
|
119
121
|
licenses:
|
120
122
|
- APL2
|
121
123
|
metadata: {}
|
@@ -140,6 +142,7 @@ signing_key:
|
|
140
142
|
specification_version: 4
|
141
143
|
summary: puppet-lint reference_syntax check
|
142
144
|
test_files:
|
145
|
+
- spec/puppet-lint/plugins/resource_reference_chain_without_whitespace_spec.rb
|
143
146
|
- spec/puppet-lint/plugins/resource_reference_without_title_capital_spec.rb
|
144
147
|
- spec/puppet-lint/plugins/resource_reference_without_whitespace_spec.rb
|
145
148
|
- spec/spec_helper.rb
|