puppet-lint 2.4.0 → 2.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +14 -0
- data/lib/puppet-lint/lexer.rb +9 -1
- data/lib/puppet-lint/lexer/string_slurper.rb +5 -0
- data/lib/puppet-lint/version.rb +1 -1
- data/spec/puppet-lint/lexer/string_slurper_spec.rb +10 -2
- data/spec/puppet-lint/lexer_spec.rb +15 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f5218ad907f8d7979c11e6275ee5747650d18ab7586ce531f8628d5a493f99ae
|
4
|
+
data.tar.gz: 521f517cf4f8cdb13a633ecb0498c3dfe23566e3584a7299950c9f8b22af44c9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fea7721ce15f702e1e66fb153724f6a27af58a9f44bb0dede58cda9582d0c63729f76cff5cbc48ff0a8784515f8a10bceb196b8c887791b8bbfaecfcd7338377
|
7
|
+
data.tar.gz: 2021cdd71199fe62955b5f940545a8f84a124ccd9ab096b24eda2e13c8a5787f545235fcf7db9426dd4020503c59bc647259126dc9d14641ab1cd09d4a4e8aaf
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,19 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
## [2.4.1](https://github.com/rodjek/puppet-lint/tree/2.4.1) (2019-10-09)
|
4
|
+
[Full Changelog](https://github.com/rodjek/puppet-lint/compare/2.4.0...2.4.1)
|
5
|
+
|
6
|
+
**Fixed bugs:**
|
7
|
+
|
8
|
+
- Puppet-lint 2.4.0 - ERROR: Syntax error on line x [\#887](https://github.com/rodjek/puppet-lint/issues/887)
|
9
|
+
- Puppet-lint 2.4.0 throws misleading warning on double-quoted strings with escaped variables [\#886](https://github.com/rodjek/puppet-lint/issues/886)
|
10
|
+
- Breaks after 2.4.0 upgrade [\#885](https://github.com/rodjek/puppet-lint/issues/885)
|
11
|
+
|
12
|
+
**Merged pull requests:**
|
13
|
+
|
14
|
+
- Fix escaped ${} enclosure handling when slurping double quoted strings [\#889](https://github.com/rodjek/puppet-lint/pull/889) ([rodjek](https://github.com/rodjek))
|
15
|
+
- Fix non-indented heredoc parsing [\#888](https://github.com/rodjek/puppet-lint/pull/888) ([rodjek](https://github.com/rodjek))
|
16
|
+
|
3
17
|
## [2.4.0](https://github.com/rodjek/puppet-lint/tree/2.4.0) (2019-10-08)
|
4
18
|
[Full Changelog](https://github.com/rodjek/puppet-lint/compare/2.3.6...2.4.0)
|
5
19
|
|
data/lib/puppet-lint/lexer.rb
CHANGED
@@ -241,7 +241,7 @@ class PuppetLint
|
|
241
241
|
process_string_segments(string_segments)
|
242
242
|
length = slurper.consumed_bytes + 1
|
243
243
|
rescue PuppetLint::Lexer::StringSlurper::UnterminatedStringError
|
244
|
-
raise PuppetLint::LexerError
|
244
|
+
raise PuppetLint::LexerError.new(@line_no, @column, 'unterminated string')
|
245
245
|
end
|
246
246
|
|
247
247
|
elsif heredoc_name = chunk[%r{\A@\(("?.+?"?(:.+?)?#{WHITESPACE_RE}*(/.*?)?)\)}, 1]
|
@@ -293,6 +293,14 @@ class PuppetLint
|
|
293
293
|
length = eol.size
|
294
294
|
tokens << new_token(:NEWLINE, eol)
|
295
295
|
|
296
|
+
unless heredoc_queue.empty?
|
297
|
+
heredoc_tag = heredoc_queue.shift
|
298
|
+
slurper = PuppetLint::Lexer::StringSlurper.new(code[i + length..-1])
|
299
|
+
heredoc_segments = slurper.parse_heredoc(heredoc_tag)
|
300
|
+
process_heredoc_segments(heredoc_segments)
|
301
|
+
length += slurper.consumed_bytes
|
302
|
+
end
|
303
|
+
|
296
304
|
elsif chunk.start_with?('/')
|
297
305
|
length = 1
|
298
306
|
tokens << new_token(:DIV, '/')
|
data/lib/puppet-lint/version.rb
CHANGED
@@ -36,14 +36,22 @@ describe PuppetLint::Lexer::StringSlurper do
|
|
36
36
|
end
|
37
37
|
end
|
38
38
|
|
39
|
-
context 'an escaped $' do
|
39
|
+
context 'an escaped $var' do
|
40
40
|
let(:string) { '\$foo"' }
|
41
41
|
|
42
|
-
it 'does not create an
|
42
|
+
it 'does not create an unenclosed variable segment' do
|
43
43
|
expect(segments).to eq([[:STRING, '\$foo']])
|
44
44
|
end
|
45
45
|
end
|
46
46
|
|
47
|
+
context 'an escaped ${} enclosure' do
|
48
|
+
let(:string) { '\"\${\"string\"}\""' }
|
49
|
+
|
50
|
+
it 'does not create an interpolation segment' do
|
51
|
+
expect(segments).to eq([[:STRING, '\"\${\"string\"}\"']])
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
47
55
|
context 'a variable and a suffix' do
|
48
56
|
let(:string) { '${foo}bar"' }
|
49
57
|
|
@@ -1590,6 +1590,21 @@ END
|
|
1590
1590
|
expect(tokens[6].type).to eq(:HEREDOC)
|
1591
1591
|
expect(tokens[6].value).to eq(" foo\n ")
|
1592
1592
|
end
|
1593
|
+
|
1594
|
+
it 'should handle a heredoc with no indentation' do
|
1595
|
+
manifest = <<-END.gsub(%r{^ {6}}, '')
|
1596
|
+
$str = @(EOT)
|
1597
|
+
something
|
1598
|
+
EOT
|
1599
|
+
END
|
1600
|
+
tokens = @lexer.tokenise(manifest)
|
1601
|
+
|
1602
|
+
expect(tokens.length).to eq(8)
|
1603
|
+
expect(tokens[4].type).to eq(:HEREDOC_OPEN)
|
1604
|
+
expect(tokens[4].value).to eq('EOT')
|
1605
|
+
expect(tokens[6].type).to eq(:HEREDOC)
|
1606
|
+
expect(tokens[6].value).to eq('something')
|
1607
|
+
end
|
1593
1608
|
end
|
1594
1609
|
|
1595
1610
|
context ':HEREDOC with interpolation' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: puppet-lint
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.4.
|
4
|
+
version: 2.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tim Sharpe
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-10-
|
11
|
+
date: 2019-10-09 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: |-
|
14
14
|
Checks your Puppet manifests against the Puppetlabs
|