puppet-syntax 7.0.0 → 7.0.1
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 +4 -4
- data/CHANGELOG.md +8 -0
- data/lib/puppet-syntax/hiera.rb +1 -1
- data/lib/puppet-syntax/version.rb +1 -1
- data/spec/fixtures/hiera/hiera_badkey.yaml +11 -12
- data/spec/fixtures/hiera/hiera_badvalue.yaml +8 -0
- data/spec/puppet-syntax/hiera_spec.rb +20 -6
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c458096b405b193f2744bcc269314df50710bc6f0d6a42c86395cddceb7091ed
|
4
|
+
data.tar.gz: 28c88220e7b0f978a6672590b31e297b3fc4b63b5ce9fdc7c0565d2f8599cb5f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 975c1f133c087f92b35e173dfa755a9e3f688f9bfaf0f9bbbecb247238db285bb0997edf549091e6303b8ca11cc6e8ef9296bd2c34d7159cdf10dd6fd6f8cbe3
|
7
|
+
data.tar.gz: 02cb4c1027b2307fa4718716956c877cb40f95792d63fcd4535fcffc248648efb5419542eeb7f918f77a907a1d891215a189f1e4584ff326e301ff4386954c85
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,14 @@
|
|
2
2
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
|
5
|
+
## [v7.0.1](https://github.com/voxpupuli/puppet-syntax/tree/v7.0.1) (2025-08-14)
|
6
|
+
|
7
|
+
[Full Changelog](https://github.com/voxpupuli/puppet-syntax/compare/v7.0.0...v7.0.1)
|
8
|
+
|
9
|
+
**Fixed bugs:**
|
10
|
+
|
11
|
+
- Update Hiera key regex to Puppet supported values [\#197](https://github.com/voxpupuli/puppet-syntax/pull/197) ([rridge532](https://github.com/rridge532))
|
12
|
+
|
5
13
|
## [v7.0.0](https://github.com/voxpupuli/puppet-syntax/tree/v7.0.0) (2025-08-13)
|
6
14
|
|
7
15
|
[Full Changelog](https://github.com/voxpupuli/puppet-syntax/compare/v6.0.0...v7.0.0)
|
data/lib/puppet-syntax/hiera.rb
CHANGED
@@ -12,7 +12,7 @@ module PuppetSyntax
|
|
12
12
|
elsif !/^[a-z]+$/.match?(key) # we allow Hiera's own configuration
|
13
13
|
'Puppet automatic lookup will not look up symbols'
|
14
14
|
end
|
15
|
-
elsif !/^[a-z][a-z0-9_]
|
15
|
+
elsif !/^([a-z][a-z0-9_]+::)*[a-z0-9_][a-zA-Z0-9_]+$/.match?(key) # adapted from Puppet docs combining namespaced and un-namespaced regex
|
16
16
|
return 'Looks like a missing colon' if /[^:]:[^:]/.match?(key)
|
17
17
|
|
18
18
|
# be extra helpful
|
@@ -3,17 +3,16 @@ this_is_ok: 0
|
|
3
3
|
this_is_ok::too: 0
|
4
4
|
th1s_is_ok::two3: 0
|
5
5
|
:eventhis: 0
|
6
|
-
|
6
|
+
good::value_with_CAPS: true
|
7
|
+
rootValueWithCaps3: true
|
7
8
|
|
8
|
-
typical:typo::warning1:
|
9
|
-
::notsotypical::warning2:
|
10
|
-
noCamelCase::warning3:
|
11
|
-
|
12
|
-
:
|
13
|
-
|
9
|
+
typical:typo::warning1: true
|
10
|
+
::notsotypical::warning2: true
|
11
|
+
noCamelCase::warning3: true
|
12
|
+
root::noCamelCase::warning4: true
|
13
|
+
Leading_caps_warning5: true
|
14
|
+
namespace::Leading_warning6: true
|
15
|
+
no-hyphens::warning7: true
|
16
|
+
:picky::warning8: true
|
17
|
+
this_is::warning9:
|
14
18
|
"%{lookup('foobar'):3306}": []
|
15
|
-
this_is::warning7:
|
16
|
-
- "%{lookup('foobar'):3306}"
|
17
|
-
this_is::warning8:
|
18
|
-
foo: "%{lookup('foobar'):3306}"
|
19
|
-
this_is::warning9: "%{lookup('foo'):3306}%{lookup('bar')}"
|
@@ -43,20 +43,34 @@ describe PuppetSyntax::Hiera do
|
|
43
43
|
files = fixture_hiera(hiera_yaml)
|
44
44
|
res = subject.check(files)
|
45
45
|
(1..examples).each do |n|
|
46
|
-
expect(res).to include(
|
46
|
+
expect(res).to include(/warning#{n}:/)
|
47
47
|
end
|
48
48
|
expect(res.size).to eq examples
|
49
49
|
expect(res[0]).to match('Key :typical:typo::warning1: Looks like a missing colon')
|
50
50
|
expect(res[1]).to match('Key ::notsotypical::warning2: Puppet automatic lookup will not use leading \'::\'')
|
51
51
|
expect(res[2]).to match('Key :noCamelCase::warning3: Not a valid Puppet variable name for automatic lookup')
|
52
|
-
expect(res[3]).to match('Key :
|
53
|
-
expect(res[4]).to match('Key :
|
54
|
-
expect(res[5]).to match('Key :
|
55
|
-
expect(res[6]).to match('Key :
|
56
|
-
expect(res[7]).to match('Key :
|
52
|
+
expect(res[3]).to match('Key :root::noCamelCase::warning4: Not a valid Puppet variable name for automatic lookup')
|
53
|
+
expect(res[4]).to match('Key :Leading_caps_warning5: Not a valid Puppet variable name for automatic lookup')
|
54
|
+
expect(res[5]).to match('Key :namespace::Leading_warning6: Not a valid Puppet variable name for automatic lookup')
|
55
|
+
expect(res[6]).to match('Key :no-hyphens::warning7: Not a valid Puppet variable name for automatic lookup')
|
56
|
+
expect(res[7]).to match('Key :picky::warning8: Puppet automatic lookup will not look up symbols')
|
57
57
|
expect(res[8]).to match('Key :this_is::warning9: string after a function call but before `}` in the value')
|
58
58
|
end
|
59
59
|
|
60
|
+
it 'returns warnings for invalid values' do
|
61
|
+
hiera_yaml = 'hiera_badvalue.yaml'
|
62
|
+
examples = 3
|
63
|
+
files = fixture_hiera(hiera_yaml)
|
64
|
+
res = subject.check(files)
|
65
|
+
(1..examples).each do |n|
|
66
|
+
expect(res).to include(/warning#{n}:/)
|
67
|
+
end
|
68
|
+
expect(res.size).to eq examples
|
69
|
+
expect(res[0]).to match('Key :this_is::warning1: string after a function call but before `}` in the value')
|
70
|
+
expect(res[1]).to match('Key :this_is::warning2: string after a function call but before `}` in the value')
|
71
|
+
expect(res[2]).to match('Key :this_is::warning3: string after a function call but before `}` in the value')
|
72
|
+
end
|
73
|
+
|
60
74
|
it 'returns warnings for bad eyaml values' do
|
61
75
|
hiera_yaml = 'hiera_bad.eyaml'
|
62
76
|
examples = 6
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: puppet-syntax
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 7.0.
|
4
|
+
version: 7.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vox Pupuli
|
@@ -91,6 +91,7 @@ files:
|
|
91
91
|
- spec/fixtures/hiera/hiera_bad.eyaml
|
92
92
|
- spec/fixtures/hiera/hiera_bad.yaml
|
93
93
|
- spec/fixtures/hiera/hiera_badkey.yaml
|
94
|
+
- spec/fixtures/hiera/hiera_badvalue.yaml
|
94
95
|
- spec/fixtures/hiera/hiera_good.yaml
|
95
96
|
- spec/fixtures/hiera/hiera_key_empty.yaml
|
96
97
|
- spec/fixtures/hiera/hiera_key_no_value.yaml
|