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: 6444407fc868020ca8c63c1cc06bfeee0735f1e6
4
- data.tar.gz: 6559535d01dfde23af4c912e969c3d8bad2421e7
3
+ metadata.gz: e6b2254b49b906dcf615a464af0f38d287b95db3
4
+ data.tar.gz: 4bd200188d28bb2c13ae0f99257fd51c7cf240a6
5
5
  SHA512:
6
- metadata.gz: e25f233604d1f3870dcc7dfd3b34369e42e677d03ba153fc3e0ecbde4dff6c13a34481f137fee2a9e4687a315eb7af2e0387fb1a869c6d3af674719964a3ebc3
7
- data.tar.gz: 65941825a27dae57fd9275c4dc0015c299a90cba98e01d922de705e512864321cddcd2b93ab0684367bf975ed2c27c68eb01df2b3b783e145fa6beeb5118b330
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.next_code_token.next_code_token.next_token
8
- unless value_token.type == :SSTRING or value_token.type == :VARIABLE or value_token.type == :DQPRE or value_token.next_token.type == :SSTRING
9
- notify :error, {
10
- :message => 'resource reference with title with capital letter',
11
- :line => value_token.line,
12
- :column => value_token.column
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 => param_token.next_code_token.next_code_token.line,
17
- :column => param_token.next_code_token.next_code_token.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).to have(1).problem
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).to have(1).problem
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.7
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-16 00:00:00.000000000 Z
11
+ date: 2016-03-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: puppet-lint