puppet-lint-duplicate_class_parameters-check 1.0.3 → 1.0.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,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bd37576ccadd7950e00643ae5bf071511564842d
4
- data.tar.gz: c9faed627d84e90dff0bfa4051e3feacf7528a9a
3
+ metadata.gz: ad8bf84346ce09b36f6268ffea85e13b34696e28
4
+ data.tar.gz: c8fa8c9006fd3714de3703cc8d592ccad9003f65
5
5
  SHA512:
6
- metadata.gz: c8e4dd1d4aac280c6926d29475e3e6499e4a2b8b18853ffc6fb1595507c04cb86ef59793a9b1b4de8c6699601cdaf85cecc79d87d0d525da81aff92f247819dd
7
- data.tar.gz: 2ca2571d1e337510cdecadc4b92b4c40c4b2dcd5a0de6e1f86bbfe33e3412e79504d53b5295ceb843d689d3dc3ee602a7f22d9d2d34c9c9385df9fd923c28ffa
6
+ metadata.gz: 6ce98b5eda889442bd9e61784a6d2023962353e1890fa2288a478fc267113604742e89a5654a59f1ec9479c3320c5f6d66fcfc0b19bb5b0b09421c22c5a45c35
7
+ data.tar.gz: 28d2c4abfc70af9604093b7ee0752d26360a4da08752898ba49bab5b839eb24fd75b1159d77eb1dd7056f2bb33a612c35da6a2e58e4e151f011537f7f0d9a1f8
@@ -16,6 +16,11 @@ PuppetLint.new_check(:duplicate_class_parameters) do
16
16
  # handling for lines with an equals and a variable on the rhs
17
17
  if next_type == :EQUALS
18
18
  inside = true
19
+
20
+ two_away = token.next_code_token.next_code_token.type
21
+ if two_away == :DQPRE
22
+ inside = false
23
+ end
19
24
  elsif next_type == :COMMA
20
25
  inside = false
21
26
  end
@@ -77,6 +77,26 @@ describe 'duplicate_class_parameters' do
77
77
  end
78
78
  end
79
79
 
80
+ # bug found where a string on the RHS has a variable in it
81
+ context 'class with variable in a string on right hand side' do
82
+ let(:code) do
83
+ <<-EOS
84
+ class duplicated_string_rhs(
85
+ $initial = $sys11mysql,
86
+ $stringed = "String containing ${initial}",
87
+ ) {
88
+ file { '/tmp/my-file':
89
+ mode => '0600',
90
+ }
91
+ }
92
+ EOS
93
+ end
94
+
95
+ it 'should not detect any problems' do
96
+ expect(problems).to have(0).problems
97
+ end
98
+ end
99
+
80
100
  # Examples that should fail specs
81
101
 
82
102
  context 'class with duplicate parameters' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puppet-lint-duplicate_class_parameters-check
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dean Wilson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-11-16 00:00:00.000000000 Z
11
+ date: 2017-12-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: puppet-lint
@@ -161,7 +161,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
161
161
  version: '0'
162
162
  requirements: []
163
163
  rubyforge_project:
164
- rubygems_version: 2.5.1
164
+ rubygems_version: 2.6.11
165
165
  signing_key:
166
166
  specification_version: 4
167
167
  summary: puppet-lint duplicate class parameters check