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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6ceebbdcfd034f93f23ad05b4cfee3f46ddca9706f5123575816dd9828a24f18
4
- data.tar.gz: 86ef711394df9cfbe002775ed6c0f8cd4be2dc9dfa97bf69422a2173f16b13ae
3
+ metadata.gz: c458096b405b193f2744bcc269314df50710bc6f0d6a42c86395cddceb7091ed
4
+ data.tar.gz: 28c88220e7b0f978a6672590b31e297b3fc4b63b5ce9fdc7c0565d2f8599cb5f
5
5
  SHA512:
6
- metadata.gz: 5a0420b7318e32b07dc6a7b1a3767fb331e6dff7f93d5be0f472146321564411d893362d9fe7f7b28387d83a84cd9086e275ad72ab417b81a65b43a8ea10dfeb
7
- data.tar.gz: e5362a07fe65501abc7529c74fd10d21ff2606530ab893c352ec4cba6b640a888ee04f031a9315a981b803caf46e952cc9b2258ee7d30f8f97fb91a90253b8fe
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)
@@ -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_]+(::[a-z][a-z0-9_]+)*$/.match?(key)
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PuppetSyntax
4
- VERSION = '7.0.0'
4
+ VERSION = '7.0.1'
5
5
  end
@@ -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
- this_is_ok::concat_func: "%{lookup('foo')}%{lookup('bar')}"
6
+ good::value_with_CAPS: true
7
+ rootValueWithCaps3: true
7
8
 
8
- typical:typo::warning1: true
9
- ::notsotypical::warning2: true
10
- noCamelCase::warning3: true
11
- no-hyphens::warning4: true
12
- :picky::warning5: true
13
- this_is::warning6:
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')}"
@@ -0,0 +1,8 @@
1
+ ---
2
+ this_is_ok::concat_func: "%{lookup('foo')}%{lookup('bar')}"
3
+
4
+ this_is::warning1:
5
+ - "%{lookup('foobar'):3306}"
6
+ this_is::warning2:
7
+ foo: "%{lookup('foobar'):3306}"
8
+ this_is::warning3: "%{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(/::warning#{n}/)
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 :no-hyphens::warning4: Not a valid Puppet variable name for automatic lookup')
53
- expect(res[4]).to match('Key :picky::warning5: Puppet automatic lookup will not look up symbols')
54
- expect(res[5]).to match('Key :this_is::warning6: string after a function call but before `}` in the value')
55
- expect(res[6]).to match('Key :this_is::warning7: string after a function call but before `}` in the value')
56
- expect(res[7]).to match('Key :this_is::warning8: string after a function call but before `}` in the value')
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.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