puppetlabs-syntax 7.2.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 +7 -0
- data/.github/workflows/ci.yml +38 -0
- data/.github/workflows/mend.yml +15 -0
- data/.github/workflows/nightly.yml +30 -0
- data/.github/workflows/release.yml +16 -0
- data/.github/workflows/release_prep.yml +20 -0
- data/.gitignore +20 -0
- data/.rubocop.yml +8 -0
- data/.rubocop_todo.yml +177 -0
- data/CHANGELOG.md +183 -0
- data/CODEOWNERS +2 -0
- data/Gemfile +59 -0
- data/HISTORY.md +382 -0
- data/LICENSE.txt +22 -0
- data/README.md +198 -0
- data/Rakefile +26 -0
- data/lib/puppetlabs-syntax/hiera.rb +176 -0
- data/lib/puppetlabs-syntax/manifests.rb +70 -0
- data/lib/puppetlabs-syntax/tasks/puppetlabs-syntax.rb +86 -0
- data/lib/puppetlabs-syntax/templates.rb +90 -0
- data/lib/puppetlabs-syntax/version.rb +5 -0
- data/lib/puppetlabs-syntax.rb +42 -0
- data/puppetlabs-syntax.gemspec +28 -0
- data/spec/fixtures/hiera/data/hiera_1.yaml +0 -0
- data/spec/fixtures/hiera/data/hiera_2.eyaml +0 -0
- data/spec/fixtures/hiera/data/test/hiera_3.yaml +0 -0
- data/spec/fixtures/hiera/data/test/hiera_4.eyaml +0 -0
- data/spec/fixtures/hiera/hiera_bad.eyaml +25 -0
- data/spec/fixtures/hiera/hiera_bad.yaml +1 -0
- data/spec/fixtures/hiera/hiera_badkey.yaml +18 -0
- data/spec/fixtures/hiera/hiera_badvalue.yaml +8 -0
- data/spec/fixtures/hiera/hiera_good.eyaml +13 -0
- data/spec/fixtures/hiera/hiera_good.yaml +7 -0
- data/spec/fixtures/hiera/hiera_key_empty.yaml +0 -0
- data/spec/fixtures/hiera/hiera_key_no_value.yaml +2 -0
- data/spec/fixtures/test_module/manifests/deprecation_notice.pp +6 -0
- data/spec/fixtures/test_module/manifests/fail_error.pp +3 -0
- data/spec/fixtures/test_module/manifests/fail_warning.pp +5 -0
- data/spec/fixtures/test_module/manifests/future_syntax.pp +3 -0
- data/spec/fixtures/test_module/manifests/pass.pp +5 -0
- data/spec/fixtures/test_module/manifests/pass_storeconfigs.pp +3 -0
- data/spec/fixtures/test_module/manifests/schedule_notice.pp +5 -0
- data/spec/fixtures/test_module/manifests/tag_notice.pp +5 -0
- data/spec/fixtures/test_module/manifests/test_app.pp +3 -0
- data/spec/fixtures/test_module/templates/fail_error.epp +3 -0
- data/spec/fixtures/test_module/templates/fail_error.erb +3 -0
- data/spec/fixtures/test_module/templates/fail_error_also.epp +3 -0
- data/spec/fixtures/test_module/templates/fail_warning.erb +2 -0
- data/spec/fixtures/test_module/templates/ignore.tpl +3 -0
- data/spec/fixtures/test_module/templates/pass.epp +3 -0
- data/spec/fixtures/test_module/templates/pass.erb +2 -0
- data/spec/fixtures/test_module/templates/pass_also.epp +3 -0
- data/spec/fixtures/test_module/templates/pass_unbound_var.erb +1 -0
- data/spec/fixtures/test_module/templates/typeerror_shouldwin.erb +2 -0
- data/spec/puppetlabs-syntax/hiera_spec.rb +107 -0
- data/spec/puppetlabs-syntax/manifests_spec.rb +96 -0
- data/spec/puppetlabs-syntax/tasks/puppetlabs-syntax_spec.rb +55 -0
- data/spec/puppetlabs-syntax/templates_spec.rb +127 -0
- data/spec/puppetlabs-syntax_spec.rb +42 -0
- data/spec/spec_helper.rb +26 -0
- metadata +150 -0
data/HISTORY.md
ADDED
|
@@ -0,0 +1,382 @@
|
|
|
1
|
+
## 7.2.0
|
|
2
|
+
|
|
3
|
+
[Full Changelog](https://github.com/voxpupuli/puppet-syntax/compare/v7.1.0...v7.2.0)
|
|
4
|
+
|
|
5
|
+
**Implemented enhancements:**
|
|
6
|
+
|
|
7
|
+
- Add Ruby 4.0 support [\#208](https://github.com/voxpupuli/puppet-syntax/pull/208) ([dependabot[bot]](https://github.com/apps/dependabot))
|
|
8
|
+
|
|
9
|
+
## [v7.1.0](https://github.com/voxpupuli/puppet-syntax/tree/v7.1.0) (2026-02-13)
|
|
10
|
+
|
|
11
|
+
[Full Changelog](https://github.com/voxpupuli/puppet-syntax/compare/v7.0.1...v7.1.0)
|
|
12
|
+
|
|
13
|
+
**Implemented enhancements:**
|
|
14
|
+
|
|
15
|
+
- feature: add support for multiple encoded blocks [\#209](https://github.com/voxpupuli/puppet-syntax/pull/209) ([aba-lrettler](https://github.com/aba-lrettler))
|
|
16
|
+
|
|
17
|
+
## [v7.0.1](https://github.com/voxpupuli/puppet-syntax/tree/v7.0.1) (2025-08-14)
|
|
18
|
+
|
|
19
|
+
[Full Changelog](https://github.com/voxpupuli/puppet-syntax/compare/v7.0.0...v7.0.1)
|
|
20
|
+
|
|
21
|
+
**Fixed bugs:**
|
|
22
|
+
|
|
23
|
+
- Update Hiera key regex to Puppet supported values [\#197](https://github.com/voxpupuli/puppet-syntax/pull/197) ([rridge532](https://github.com/rridge532))
|
|
24
|
+
|
|
25
|
+
## [v7.0.0](https://github.com/voxpupuli/puppet-syntax/tree/v7.0.0) (2025-08-13)
|
|
26
|
+
|
|
27
|
+
[Full Changelog](https://github.com/voxpupuli/puppet-syntax/compare/v6.0.0...v7.0.0)
|
|
28
|
+
|
|
29
|
+
**Breaking changes:**
|
|
30
|
+
|
|
31
|
+
- Require Ruby 3.2 / OpenVox 8 [\#195](https://github.com/voxpupuli/puppet-syntax/pull/195) ([bastelfreak](https://github.com/bastelfreak))
|
|
32
|
+
- Require Ruby \>= 3.1 [\#186](https://github.com/voxpupuli/puppet-syntax/pull/186) ([bastelfreak](https://github.com/bastelfreak))
|
|
33
|
+
|
|
34
|
+
**Implemented enhancements:**
|
|
35
|
+
|
|
36
|
+
- CI: Use Vox Pupuli release defaults [\#194](https://github.com/voxpupuli/puppet-syntax/pull/194) ([bastelfreak](https://github.com/bastelfreak))
|
|
37
|
+
|
|
38
|
+
## [v6.0.0](https://github.com/voxpupuli/puppet-syntax/tree/v6.0.0) (2025-06-10)
|
|
39
|
+
|
|
40
|
+
[Full Changelog](https://github.com/voxpupuli/puppet-syntax/compare/v5.0.0...v6.0.0)
|
|
41
|
+
|
|
42
|
+
**Breaking changes:**
|
|
43
|
+
|
|
44
|
+
- Switch from puppet to openvox [\#189](https://github.com/voxpupuli/puppet-syntax/pull/189) ([bastelfreak](https://github.com/bastelfreak))
|
|
45
|
+
|
|
46
|
+
## [v5.0.0](https://github.com/voxpupuli/puppet-syntax/tree/v5.0.0) (2025-05-23)
|
|
47
|
+
|
|
48
|
+
[Full Changelog](https://github.com/voxpupuli/puppet-syntax/compare/v4.1.1...v5.0.0)
|
|
49
|
+
|
|
50
|
+
**Breaking changes:**
|
|
51
|
+
|
|
52
|
+
- Set default exclude paths [\#181](https://github.com/voxpupuli/puppet-syntax/pull/181) ([bastelfreak](https://github.com/bastelfreak))
|
|
53
|
+
- Enable Hiera syntax check [\#167](https://github.com/voxpupuli/puppet-syntax/pull/167) ([bastelfreak](https://github.com/bastelfreak))
|
|
54
|
+
|
|
55
|
+
**Implemented enhancements:**
|
|
56
|
+
|
|
57
|
+
- Detect Hiera files that are not valid hashes [\#184](https://github.com/voxpupuli/puppet-syntax/pull/184) ([bastelfreak](https://github.com/bastelfreak))
|
|
58
|
+
- CI: Switch to voxpupuli/ruby-version@v1 & Add Ruby 3.4 support [\#180](https://github.com/voxpupuli/puppet-syntax/pull/180) ([bastelfreak](https://github.com/bastelfreak))
|
|
59
|
+
|
|
60
|
+
**Merged pull requests:**
|
|
61
|
+
|
|
62
|
+
- Drop unused pry & rb-readline dev dependencies [\#182](https://github.com/voxpupuli/puppet-syntax/pull/182) ([bastelfreak](https://github.com/bastelfreak))
|
|
63
|
+
- Cleanup Rakefile; remove legacy tasks [\#173](https://github.com/voxpupuli/puppet-syntax/pull/173) ([bastelfreak](https://github.com/bastelfreak))
|
|
64
|
+
|
|
65
|
+
## [v4.1.1](https://github.com/voxpupuli/puppet-syntax/tree/v4.1.1) (2024-04-04)
|
|
66
|
+
|
|
67
|
+
[Full Changelog](https://github.com/voxpupuli/puppet-syntax/compare/v4.1.0...v4.1.1)
|
|
68
|
+
|
|
69
|
+
**Fixed bugs:**
|
|
70
|
+
|
|
71
|
+
- fix too greedy regular expression [\#171](https://github.com/voxpupuli/puppet-syntax/pull/171) ([sprd-tmu](https://github.com/sprd-tmu))
|
|
72
|
+
|
|
73
|
+
## [v4.1.0](https://github.com/voxpupuli/puppet-syntax/tree/v4.1.0) (2024-03-12)
|
|
74
|
+
|
|
75
|
+
[Full Changelog](https://github.com/voxpupuli/puppet-syntax/compare/v4.0.1...v4.1.0)
|
|
76
|
+
|
|
77
|
+
**Implemented enhancements:**
|
|
78
|
+
|
|
79
|
+
- Hiera: Test for wrong interpolation syntax [\#143](https://github.com/voxpupuli/puppet-syntax/pull/143) ([bastelfreak](https://github.com/bastelfreak))
|
|
80
|
+
|
|
81
|
+
## [v4.0.1](https://github.com/voxpupuli/puppet-syntax/tree/v4.0.1) (2024-03-12)
|
|
82
|
+
|
|
83
|
+
[Full Changelog](https://github.com/voxpupuli/puppet-syntax/compare/v4.0.0...v4.0.1)
|
|
84
|
+
|
|
85
|
+
**Fixed bugs:**
|
|
86
|
+
|
|
87
|
+
- Raise warning if hiera check is called but disabled [\#165](https://github.com/voxpupuli/puppet-syntax/pull/165) ([bastelfreak](https://github.com/bastelfreak))
|
|
88
|
+
|
|
89
|
+
**Merged pull requests:**
|
|
90
|
+
|
|
91
|
+
- Drop Puppet 5.4 check [\#166](https://github.com/voxpupuli/puppet-syntax/pull/166) ([bastelfreak](https://github.com/bastelfreak))
|
|
92
|
+
- README.md: Update required Puppet/Ruby versions [\#164](https://github.com/voxpupuli/puppet-syntax/pull/164) ([bastelfreak](https://github.com/bastelfreak))
|
|
93
|
+
- Update voxpupuli-rubocop requirement from ~\> 2.4.0 to ~\> 2.5.0 [\#163](https://github.com/voxpupuli/puppet-syntax/pull/163) ([dependabot[bot]](https://github.com/apps/dependabot))
|
|
94
|
+
|
|
95
|
+
## [v4.0.0](https://github.com/voxpupuli/puppet-syntax/tree/v4.0.0) (2024-02-07)
|
|
96
|
+
|
|
97
|
+
[Full Changelog](https://github.com/voxpupuli/puppet-syntax/compare/v3.3.0...v4.0.0)
|
|
98
|
+
|
|
99
|
+
**Breaking changes:**
|
|
100
|
+
|
|
101
|
+
- Drop Ruby 2.4/2.5/2.6 & Puppet 5/6 support [\#145](https://github.com/voxpupuli/puppet-syntax/pull/145) ([bastelfreak](https://github.com/bastelfreak))
|
|
102
|
+
|
|
103
|
+
**Implemented enhancements:**
|
|
104
|
+
|
|
105
|
+
- Add Ruby 3.2 / Puppet 8 support [\#147](https://github.com/voxpupuli/puppet-syntax/pull/147) ([bastelfreak](https://github.com/bastelfreak))
|
|
106
|
+
- support aliases in hiera yaml [\#144](https://github.com/voxpupuli/puppet-syntax/pull/144) ([akerl](https://github.com/akerl))
|
|
107
|
+
- Implement RuboCop [\#137](https://github.com/voxpupuli/puppet-syntax/pull/137) ([bastelfreak](https://github.com/bastelfreak))
|
|
108
|
+
|
|
109
|
+
**Fixed bugs:**
|
|
110
|
+
|
|
111
|
+
- fix "NameError: uninitialized constant Puppet::Util" [\#155](https://github.com/voxpupuli/puppet-syntax/pull/155) ([mxey](https://github.com/mxey))
|
|
112
|
+
- add all known hiera-eyaml methods [\#154](https://github.com/voxpupuli/puppet-syntax/pull/154) ([mxey](https://github.com/mxey))
|
|
113
|
+
|
|
114
|
+
**Merged pull requests:**
|
|
115
|
+
|
|
116
|
+
- README.md: Fix badges [\#161](https://github.com/voxpupuli/puppet-syntax/pull/161) ([bastelfreak](https://github.com/bastelfreak))
|
|
117
|
+
- gemspec: Add version requirements & CI: Build Gems ins strict & verbose mode [\#160](https://github.com/voxpupuli/puppet-syntax/pull/160) ([bastelfreak](https://github.com/bastelfreak))
|
|
118
|
+
- Update voxpupuli-rubocop requirement from ~\> 2.0.0 to ~\> 2.4.0 [\#159](https://github.com/voxpupuli/puppet-syntax/pull/159) ([dependabot[bot]](https://github.com/apps/dependabot))
|
|
119
|
+
- Update voxpupuli-rubocop requirement from ~\> 1.4.0 to ~\> 2.0.0 [\#152](https://github.com/voxpupuli/puppet-syntax/pull/152) ([dependabot[bot]](https://github.com/apps/dependabot))
|
|
120
|
+
- GCG: Add faraday-retry dep [\#149](https://github.com/voxpupuli/puppet-syntax/pull/149) ([bastelfreak](https://github.com/bastelfreak))
|
|
121
|
+
- Switch to voxpupuli-rubocop [\#148](https://github.com/voxpupuli/puppet-syntax/pull/148) ([bastelfreak](https://github.com/bastelfreak))
|
|
122
|
+
- CI: add dummy job to depend on [\#146](https://github.com/voxpupuli/puppet-syntax/pull/146) ([bastelfreak](https://github.com/bastelfreak))
|
|
123
|
+
- Drop Ruby 1.8 testcode [\#142](https://github.com/voxpupuli/puppet-syntax/pull/142) ([bastelfreak](https://github.com/bastelfreak))
|
|
124
|
+
- rubocop: fix whitespace and newline warnings [\#141](https://github.com/voxpupuli/puppet-syntax/pull/141) ([bastelfreak](https://github.com/bastelfreak))
|
|
125
|
+
- rubocop: fix trailing comma [\#140](https://github.com/voxpupuli/puppet-syntax/pull/140) ([bastelfreak](https://github.com/bastelfreak))
|
|
126
|
+
|
|
127
|
+
## [v3.3.0](https://github.com/voxpupuli/puppet-syntax/tree/v3.3.0) (2023-02-08)
|
|
128
|
+
|
|
129
|
+
[Full Changelog](https://github.com/voxpupuli/puppet-syntax/compare/v3.2.1...v3.3.0)
|
|
130
|
+
|
|
131
|
+
**Implemented enhancements:**
|
|
132
|
+
|
|
133
|
+
- Lazy load required classes [\#134](https://github.com/voxpupuli/puppet-syntax/pull/134) ([ekohl](https://github.com/ekohl))
|
|
134
|
+
|
|
135
|
+
**Merged pull requests:**
|
|
136
|
+
|
|
137
|
+
- Pull in Puppet 6.29 in CI [\#135](https://github.com/voxpupuli/puppet-syntax/pull/135) ([ekohl](https://github.com/ekohl))
|
|
138
|
+
|
|
139
|
+
## [v3.2.1](https://github.com/voxpupuli/puppet-syntax/tree/v3.2.1) (2022-05-16)
|
|
140
|
+
|
|
141
|
+
[Full Changelog](https://github.com/voxpupuli/puppet-syntax/compare/v3.2.0...v3.2.1)
|
|
142
|
+
|
|
143
|
+
## [v3.2.0](https://github.com/voxpupuli/puppet-syntax/tree/v3.2.0) (2022-05-16)
|
|
144
|
+
|
|
145
|
+
[Full Changelog](https://github.com/voxpupuli/puppet-syntax/compare/v3.1.0...v3.2.0)
|
|
146
|
+
|
|
147
|
+
**Implemented enhancements:**
|
|
148
|
+
|
|
149
|
+
- Remove AppVeyor testing [\#94](https://github.com/voxpupuli/puppet-syntax/issues/94)
|
|
150
|
+
- Convert from Travis CI to GitHub Actions [\#130](https://github.com/voxpupuli/puppet-syntax/pull/130) ([ekohl](https://github.com/ekohl))
|
|
151
|
+
|
|
152
|
+
**Fixed bugs:**
|
|
153
|
+
|
|
154
|
+
- Add missing `$` in github action [\#132](https://github.com/voxpupuli/puppet-syntax/pull/132) ([bastelfreak](https://github.com/bastelfreak))
|
|
155
|
+
|
|
156
|
+
## [v3.1.0](https://github.com/voxpupuli/puppet-syntax/tree/v3.1.0) (2020-06-24)
|
|
157
|
+
|
|
158
|
+
[Full Changelog](https://github.com/voxpupuli/puppet-syntax/compare/v3.0.1...v3.1.0)
|
|
159
|
+
|
|
160
|
+
**Implemented enhancements:**
|
|
161
|
+
|
|
162
|
+
- print actual template errors on $stderr [\#125](https://github.com/voxpupuli/puppet-syntax/pull/125) ([foxxx0](https://github.com/foxxx0))
|
|
163
|
+
|
|
164
|
+
**Merged pull requests:**
|
|
165
|
+
|
|
166
|
+
- Add ruby2.7 testing, replacing multiple obsolete puppet6 versions [\#124](https://github.com/voxpupuli/puppet-syntax/pull/124) ([DavidS](https://github.com/DavidS))
|
|
167
|
+
|
|
168
|
+
## [v3.0.1](https://github.com/voxpupuli/puppet-syntax/tree/v3.0.1) (2020-05-27)
|
|
169
|
+
|
|
170
|
+
[Full Changelog](https://github.com/voxpupuli/puppet-syntax/compare/v3.0.0...v3.0.1)
|
|
171
|
+
|
|
172
|
+
**Merged pull requests:**
|
|
173
|
+
|
|
174
|
+
- Avoid failure on schedule metaparameter warning [\#122](https://github.com/voxpupuli/puppet-syntax/pull/122) ([ffapitalle](https://github.com/ffapitalle))
|
|
175
|
+
|
|
176
|
+
## [v3.0.0](https://github.com/voxpupuli/puppet-syntax/tree/v3.0.0) (2020-05-09)
|
|
177
|
+
|
|
178
|
+
[Full Changelog](https://github.com/voxpupuli/puppet-syntax/compare/v2.6.1...v3.0.0)
|
|
179
|
+
|
|
180
|
+
**Breaking changes:**
|
|
181
|
+
|
|
182
|
+
- Drop legacy code to support Puppet \< 5 and Ruby \< 2.4 [\#120](https://github.com/voxpupuli/puppet-syntax/pull/120) ([ekohl](https://github.com/ekohl))
|
|
183
|
+
|
|
184
|
+
**Implemented enhancements:**
|
|
185
|
+
|
|
186
|
+
- Migrate Changelog to GCG [\#93](https://github.com/voxpupuli/puppet-syntax/issues/93)
|
|
187
|
+
|
|
188
|
+
**Merged pull requests:**
|
|
189
|
+
|
|
190
|
+
- cleanup README.md / fix markdown linter warnings [\#119](https://github.com/voxpupuli/puppet-syntax/pull/119) ([bastelfreak](https://github.com/bastelfreak))
|
|
191
|
+
|
|
192
|
+
## [v2.6.1](https://github.com/voxpupuli/puppet-syntax/tree/v2.6.1) (2020-01-11)
|
|
193
|
+
|
|
194
|
+
[Full Changelog](https://github.com/voxpupuli/puppet-syntax/compare/v2.6.0...v2.6.1)
|
|
195
|
+
|
|
196
|
+
**Fixed bugs:**
|
|
197
|
+
|
|
198
|
+
- Add `puppet` gem as runtime dependency [\#116](https://github.com/voxpupuli/puppet-syntax/pull/116) ([bastelfreak](https://github.com/bastelfreak))
|
|
199
|
+
|
|
200
|
+
**Merged pull requests:**
|
|
201
|
+
|
|
202
|
+
- traivs: run tests on Ubuntu 18.04 [\#117](https://github.com/voxpupuli/puppet-syntax/pull/117) ([bastelfreak](https://github.com/bastelfreak))
|
|
203
|
+
- travis: enable irc / disable email notifications [\#114](https://github.com/voxpupuli/puppet-syntax/pull/114) ([bastelfreak](https://github.com/bastelfreak))
|
|
204
|
+
|
|
205
|
+
## [v2.6.0](https://github.com/voxpupuli/puppet-syntax/tree/v2.6.0) (2019-10-05)
|
|
206
|
+
|
|
207
|
+
[Full Changelog](https://github.com/voxpupuli/puppet-syntax/compare/v2.5.0...v2.6.0)
|
|
208
|
+
|
|
209
|
+
**Implemented enhancements:**
|
|
210
|
+
|
|
211
|
+
- add support for validating puppet plans \(fixes \#95, fixes \#96\) [\#97](https://github.com/voxpupuli/puppet-syntax/pull/97) ([slauger](https://github.com/slauger))
|
|
212
|
+
- Allow specifying file paths for manifests and templates too [\#87](https://github.com/voxpupuli/puppet-syntax/pull/87) ([lavagetto](https://github.com/lavagetto))
|
|
213
|
+
|
|
214
|
+
**Merged pull requests:**
|
|
215
|
+
|
|
216
|
+
- Test on ruby 2.6 [\#111](https://github.com/voxpupuli/puppet-syntax/pull/111) ([alexjfisher](https://github.com/alexjfisher))
|
|
217
|
+
- Adding KMS tags to allowed EYAML methods [\#105](https://github.com/voxpupuli/puppet-syntax/pull/105) ([craigwatson](https://github.com/craigwatson))
|
|
218
|
+
|
|
219
|
+
## [v2.5.0](https://github.com/voxpupuli/puppet-syntax/tree/v2.5.0) (2019-07-07)
|
|
220
|
+
|
|
221
|
+
[Full Changelog](https://github.com/voxpupuli/puppet-syntax/compare/v2.4.3...v2.5.0)
|
|
222
|
+
|
|
223
|
+
**Implemented enhancements:**
|
|
224
|
+
|
|
225
|
+
- Support puppet 6.5 [\#106](https://github.com/voxpupuli/puppet-syntax/pull/106) ([alexjfisher](https://github.com/alexjfisher))
|
|
226
|
+
|
|
227
|
+
## [v2.4.3](https://github.com/voxpupuli/puppet-syntax/tree/v2.4.3) (2019-02-09)
|
|
228
|
+
|
|
229
|
+
[Full Changelog](https://github.com/voxpupuli/puppet-syntax/compare/v2.4.2...v2.4.3)
|
|
230
|
+
|
|
231
|
+
**Fixed bugs:**
|
|
232
|
+
|
|
233
|
+
- Revert "search manifests in manifests directory" [\#102](https://github.com/voxpupuli/puppet-syntax/pull/102) ([alexjfisher](https://github.com/alexjfisher))
|
|
234
|
+
|
|
235
|
+
## [v2.4.2](https://github.com/voxpupuli/puppet-syntax/tree/v2.4.2) (2019-02-08)
|
|
236
|
+
|
|
237
|
+
[Full Changelog](https://github.com/voxpupuli/puppet-syntax/compare/v2.4.1...v2.4.2)
|
|
238
|
+
|
|
239
|
+
- Search manifests in manifests directory
|
|
240
|
+
- Allow .yml as an extension for YAML files.
|
|
241
|
+
- Ensure the pkg directory is always excluded
|
|
242
|
+
- Check consistency of ENC blobs in eyaml data
|
|
243
|
+
|
|
244
|
+
## [v2.4.1](https://github.com/voxpupuli/puppet-syntax/tree/v2.4.1) (2017-06-29)
|
|
245
|
+
|
|
246
|
+
[Full Changelog](https://github.com/voxpupuli/puppet-syntax/compare/v2.4.0...v2.4.1)
|
|
247
|
+
|
|
248
|
+
- Fix to ensure namespace scope is inherited.
|
|
249
|
+
- Cleanly exits when syntax warnings/errors are found instead of failing.
|
|
250
|
+
|
|
251
|
+
## [v2.4.0](https://github.com/voxpupuli/puppet-syntax/tree/v2.4.0) (2017-03-14)
|
|
252
|
+
|
|
253
|
+
[Full Changelog](https://github.com/voxpupuli/puppet-syntax/compare/v2.3.0...v2.4.0)
|
|
254
|
+
|
|
255
|
+
- Add check_hiera_keys flag for deep checking of Hiera key name correctness. Thanks @petems.
|
|
256
|
+
- Fix Puppet version comparisons for compatibility with Puppet 4.10.
|
|
257
|
+
- Fix app_management setting compatibility with Puppet 5.
|
|
258
|
+
- Refactor PUPPETVERSION usage to Puppet.version public API.
|
|
259
|
+
|
|
260
|
+
## [v2.3.0](https://github.com/voxpupuli/puppet-syntax/tree/v2.3.0) (2017-02-01)
|
|
261
|
+
|
|
262
|
+
[Full Changelog](https://github.com/voxpupuli/puppet-syntax/compare/v2.2.0...v2.3.0)
|
|
263
|
+
|
|
264
|
+
- Add app_management flag for Puppet application orchestration support. Thanks @ipcrm.
|
|
265
|
+
- Check all *yaml file extensions, including eyaml. thanks @kjetilho, @rjw1.
|
|
266
|
+
- Only test ERB syntax in files with an *.erb extension. Thanks @alexiri.
|
|
267
|
+
- Extend README to list specific files and checks implemented. Thanks @petems.
|
|
268
|
+
- Refactor Rake filelist generation, add tests. Thanks @kjetilho, @rjw1.
|
|
269
|
+
|
|
270
|
+
## [v2.2.0](https://github.com/voxpupuli/puppet-syntax/tree/v2.2.0) (2016-12-02)
|
|
271
|
+
|
|
272
|
+
[Full Changelog](https://github.com/voxpupuli/puppet-syntax/compare/v2.1.1...v2.2.0)
|
|
273
|
+
|
|
274
|
+
- Replace Puppet.initialize_settings with Puppet::Test::TestHelper. Thanks @domcleal #60
|
|
275
|
+
This clears out caches on every test so increases runtime.
|
|
276
|
+
|
|
277
|
+
## [v2.1.1](https://github.com/voxpupuli/puppet-syntax/tree/v2.1.1) (2016-10-21)
|
|
278
|
+
|
|
279
|
+
[Full Changelog](https://github.com/voxpupuli/puppet-syntax/compare/v2.1.0...v2.1.1)
|
|
280
|
+
|
|
281
|
+
- Use `$stderr.puts` rather than `warn` and `info` (thanks @mmckinst)
|
|
282
|
+
- Allow latest 3.x to validate EPP files (thanks @DavidS)
|
|
283
|
+
|
|
284
|
+
## [v2.1.0](https://github.com/voxpupuli/puppet-syntax/tree/v2.1.0) (2016-01-18)
|
|
285
|
+
|
|
286
|
+
[Full Changelog](https://github.com/voxpupuli/puppet-syntax/compare/v2.0.0...v2.1.0)
|
|
287
|
+
|
|
288
|
+
- Support Puppet 4. Many thanks to @DavidS
|
|
289
|
+
- Support validation of EPP templates. Thanks to @trlinkin
|
|
290
|
+
- Test improvements and refactoring, including Travis CI tests against Puppet 4. Thanks to @trlinkin
|
|
291
|
+
- Don't error when a tag metaparameter is present. Thank you @dhardy92
|
|
292
|
+
- Report the filename of invalid hiera data files. Thanks @danzilio
|
|
293
|
+
|
|
294
|
+
## [v2.0.0](https://github.com/voxpupuli/puppet-syntax/tree/v2.0.0) (2015-02-26)
|
|
295
|
+
|
|
296
|
+
[Full Changelog](https://github.com/voxpupuli/puppet-syntax/compare/v1.4.1...v2.0.0)
|
|
297
|
+
|
|
298
|
+
- Removed support for Puppet version 2.7.x
|
|
299
|
+
- New option, fail_on_deprecation_notices, which defaults to true (compatible
|
|
300
|
+
with previous behaviour); thanks @pcfens
|
|
301
|
+
- PuppetSyntax::Manifests#check now has two return arguments
|
|
302
|
+
|
|
303
|
+
## [v1.4.1](https://github.com/voxpupuli/puppet-syntax/tree/v1.4.1) (2015-01-08)
|
|
304
|
+
|
|
305
|
+
[Full Changelog](https://github.com/voxpupuli/puppet-syntax/compare/v1.4.0...v1.4.1)
|
|
306
|
+
|
|
307
|
+
- Support appending to config arrays, thanks @domcleal
|
|
308
|
+
|
|
309
|
+
## [v1.4.0](https://github.com/voxpupuli/puppet-syntax/tree/v1.4.0) (2014-12-18)
|
|
310
|
+
|
|
311
|
+
[Full Changelog](https://github.com/voxpupuli/puppet-syntax/compare/v1.3.0...v1.4.0)
|
|
312
|
+
|
|
313
|
+
- Rspec 3 is now supported, thanks @tuxmea
|
|
314
|
+
- Build error fixed where gem_publisher was used prematurely
|
|
315
|
+
- Lazy load Puppet only when it's required, thanks @logicminds
|
|
316
|
+
|
|
317
|
+
## [v1.3.0](https://github.com/voxpupuli/puppet-syntax/tree/v1.3.0) (2014-08-07)
|
|
318
|
+
|
|
319
|
+
[Full Changelog](https://github.com/voxpupuli/puppet-syntax/compare/v1.2.3...v1.3.0)
|
|
320
|
+
|
|
321
|
+
- Add the ability to pass hieradata_paths array of globs to check
|
|
322
|
+
- Check hieradata in modules ('**/data/**/*.yaml') by default
|
|
323
|
+
|
|
324
|
+
## [v1.2.3](https://github.com/voxpupuli/puppet-syntax/tree/v1.2.3) (2014-08-06)
|
|
325
|
+
|
|
326
|
+
[Full Changelog](https://github.com/voxpupuli/puppet-syntax/compare/v1.2.2...v1.2.3)
|
|
327
|
+
|
|
328
|
+
- Fix puppetlabs_spec_helper warning on Ruby 1.8
|
|
329
|
+
|
|
330
|
+
## [v1.2.2](https://github.com/voxpupuli/puppet-syntax/tree/v1.2.2) (2014-07-31)
|
|
331
|
+
|
|
332
|
+
[Full Changelog](https://github.com/voxpupuli/puppet-syntax/compare/v1.2.0...v1.2.2)
|
|
333
|
+
|
|
334
|
+
- Check and document conflicts with puppetlabs_spec_helper <= 0.7.0
|
|
335
|
+
|
|
336
|
+
## v1.2.1 (2014-07-23)
|
|
337
|
+
|
|
338
|
+
- Remove dependency on Puppet from Gemspec (for Puppet Entreprise users).
|
|
339
|
+
|
|
340
|
+
## v1.2.0 (2014-03-28)
|
|
341
|
+
|
|
342
|
+
- Optional support for Puppet's future parser.
|
|
343
|
+
|
|
344
|
+
## v1.1.1 (2014-03-17)
|
|
345
|
+
|
|
346
|
+
- Ignore exit(1) from Puppet 3.4
|
|
347
|
+
- Don't use hardcoded version of parser face.
|
|
348
|
+
|
|
349
|
+
## v1.1.0 (2013-09-06)
|
|
350
|
+
|
|
351
|
+
- Syntax checks for Hiera YAML files.
|
|
352
|
+
- Improved documentation.
|
|
353
|
+
|
|
354
|
+
## v1.0.0 (2013-07-04)
|
|
355
|
+
|
|
356
|
+
- Refactor code to make it easier to test.
|
|
357
|
+
- Implement spec tests for syntax checks.
|
|
358
|
+
- Pending spec tests for FileList matching.
|
|
359
|
+
- Matrix tests for other Ruby/Puppet versions.
|
|
360
|
+
- Improve usage example in README.
|
|
361
|
+
|
|
362
|
+
## v0.0.4 (2013-06-14)
|
|
363
|
+
|
|
364
|
+
- Fix `$confdir` error for Puppet 3.x
|
|
365
|
+
|
|
366
|
+
## v0.0.3 (2013-06-11)
|
|
367
|
+
|
|
368
|
+
- List rake as a dependency.
|
|
369
|
+
- Output names of tasks to STDERR.
|
|
370
|
+
- Match template paths correctly.
|
|
371
|
+
- Add pending spec tests, not yet working.
|
|
372
|
+
|
|
373
|
+
## v0.0.2 (2013-06-10)
|
|
374
|
+
|
|
375
|
+
- Fix namespacing of rake tasks.
|
|
376
|
+
|
|
377
|
+
## v0.0.1 (2013-06-10)
|
|
378
|
+
|
|
379
|
+
- Initial release
|
|
380
|
+
|
|
381
|
+
|
|
382
|
+
\* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*
|
data/LICENSE.txt
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
Copyright (c) 2013 Dan Carley
|
|
2
|
+
|
|
3
|
+
MIT License
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
6
|
+
a copy of this software and associated documentation files (the
|
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
11
|
+
the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be
|
|
14
|
+
included in all copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
# puppetlabs-syntax
|
|
2
|
+
|
|
3
|
+
> This is the Perforce-maintained puppetlabs fork of [voxpupuli/puppet-syntax](https://github.com/voxpupuli/puppet-syntax). It exists to unblock puppet ↔ openvox core switching in downstream apps. Not a drop-in replacement for the upstream gem.
|
|
4
|
+
|
|
5
|
+
[](https://github.com/puppetlabs/puppetlabs-syntax/blob/main/LICENSE.txt)
|
|
6
|
+
[](https://github.com/puppetlabs/puppetlabs-syntax/actions/workflows/release.yml)
|
|
7
|
+
[](https://github.com/puppetlabs/puppetlabs-syntax/actions/workflows/ci.yml)
|
|
8
|
+
[](https://rubygems.org/gems/puppetlabs-syntax)
|
|
9
|
+
[](https://rubygems.org/gems/puppetlabs-syntax)
|
|
10
|
+
|
|
11
|
+
# Puppetlabs::Syntax
|
|
12
|
+
|
|
13
|
+
Puppetlabs::Syntax checks for correct syntax in Puppet manifests, templates, and
|
|
14
|
+
Hiera YAML.
|
|
15
|
+
|
|
16
|
+
## Version support
|
|
17
|
+
|
|
18
|
+
Puppetlabs::Syntax is supported with:
|
|
19
|
+
|
|
20
|
+
- Puppet >= 8.0, < 10
|
|
21
|
+
- Ruby >= 3.2
|
|
22
|
+
|
|
23
|
+
For the specific versions that we test against, see the [GitHub Actions workflow](.github/workflows/ci.yml) or the [Gem spec](puppetlabs-syntax.gemspec).
|
|
24
|
+
|
|
25
|
+
## Installation
|
|
26
|
+
|
|
27
|
+
To install Puppetlabs::Syntax, either add it to your module's Gemfile or install
|
|
28
|
+
the gem manually.
|
|
29
|
+
|
|
30
|
+
* To install with the Gemfile, add:
|
|
31
|
+
|
|
32
|
+
```ruby
|
|
33
|
+
gem 'puppetlabs-syntax'
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
And then execute:
|
|
37
|
+
|
|
38
|
+
```sh
|
|
39
|
+
bundle install
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
* To install the gem yourself, run:
|
|
43
|
+
|
|
44
|
+
```sh
|
|
45
|
+
gem install puppetlabs-syntax
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Configuration
|
|
49
|
+
|
|
50
|
+
To configure Puppetlabs::Syntax, add any of the following settings to your `Rakefile`.
|
|
51
|
+
|
|
52
|
+
* To exclude certain paths from the syntax checks, set:
|
|
53
|
+
|
|
54
|
+
```ruby
|
|
55
|
+
PuppetlabsSyntax.exclude_paths = ["vendor/**/*"]
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
* To configure specific paths for the Hiera syntax check, specify `hieradata_paths`. This is useful if you use Hiera data inside your module.
|
|
59
|
+
|
|
60
|
+
```ruby
|
|
61
|
+
PuppetlabsSyntax.hieradata_paths = ["**/data/**/*.yaml", "hieradata/**/*.yaml", "hiera*.yaml"]
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
* To configure specific paths for the Puppet syntax checks or for the templates checks, specify `manifests_paths` or `templates_paths` respectively. This is useful if you want to check specific paths only.
|
|
65
|
+
|
|
66
|
+
```ruby
|
|
67
|
+
PuppetlabsSyntax.manifests_paths = ["**/environments/future/*.pp"]
|
|
68
|
+
PuppetlabsSyntax.templates_paths = ["**/modules/**/templates/*.erb"]
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
* To ignore deprecation warnings, disable `fail_on_deprecation_notices`. By default, `puppetlabs-syntax` fails if it encounters Puppet deprecation notices. If you are working with a legacy code base and want to ignore such non-fatal warnings, you might want to override the default behavior.
|
|
72
|
+
|
|
73
|
+
```ruby
|
|
74
|
+
PuppetlabsSyntax.fail_on_deprecation_notices = false
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
* To enable a syntax check on Hiera keys, set:
|
|
78
|
+
|
|
79
|
+
```ruby
|
|
80
|
+
PuppetlabsSyntax.check_hiera_keys = true
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
This reports common mistakes in key names in Hiera files, such as:
|
|
84
|
+
|
|
85
|
+
* Leading `::` in keys, such as: `::notsotypical::warning2: true`.
|
|
86
|
+
* Single colon scope separators, such as: `:picky::warning5: true`.
|
|
87
|
+
* Invalid camel casing, such as: `noCamelCase::warning3: true`.
|
|
88
|
+
* Use of hyphens, such as: `no-hyphens::warning4: true`.
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
* To enable a syntax check on Hiera values, set:
|
|
92
|
+
|
|
93
|
+
```ruby
|
|
94
|
+
PuppetlabsSyntax.check_hiera_data = true
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## Usage
|
|
98
|
+
|
|
99
|
+
* To enable Puppetlabs::Syntax, include the following in your module's `Rakefile`:
|
|
100
|
+
|
|
101
|
+
```ruby
|
|
102
|
+
require 'puppetlabs-syntax/tasks/puppetlabs-syntax'
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
For Continuous Integration, use Puppetlabs::Syntax in conjunction with `puppet-lint`
|
|
106
|
+
and spec tests. Add the following to your module's `Rakefile`:
|
|
107
|
+
|
|
108
|
+
```ruby
|
|
109
|
+
task :test => [
|
|
110
|
+
:syntax,
|
|
111
|
+
:lint,
|
|
112
|
+
:spec,
|
|
113
|
+
]
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
* To test all manifests and templates, relative to the location of the `Rakefile`, run:
|
|
117
|
+
|
|
118
|
+
```shell
|
|
119
|
+
$ bundle exec rake syntax
|
|
120
|
+
---> syntax:manifests
|
|
121
|
+
---> syntax:templates
|
|
122
|
+
---> syntax:hiera:yaml
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
* To return a non-zero exit code and an error message on any failures, run:
|
|
126
|
+
|
|
127
|
+
```shell
|
|
128
|
+
$ bundle exec rake syntax
|
|
129
|
+
---> syntax:manifests
|
|
130
|
+
rake aborted!
|
|
131
|
+
Could not parse for environment production: Syntax error at end of file at demo.pp:2
|
|
132
|
+
Tasks: TOP => syntax => syntax:manifests
|
|
133
|
+
(See full trace by running task with --trace)
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
## Checks
|
|
137
|
+
|
|
138
|
+
Puppetlabs::Syntax makes the following checks in the directories and subdirectories
|
|
139
|
+
of the module, relative to the location of the `Rakefile`.
|
|
140
|
+
|
|
141
|
+
### Hiera
|
|
142
|
+
|
|
143
|
+
Checks `.yaml` files for syntax errors.
|
|
144
|
+
|
|
145
|
+
By default, this rake task looks for all `.yaml` files in a single module under:
|
|
146
|
+
|
|
147
|
+
* `**/data/**/*.yaml`
|
|
148
|
+
* `hieradata/**/*.yaml`
|
|
149
|
+
* `hiera*.yaml`
|
|
150
|
+
|
|
151
|
+
It will validate the syntax of each Hiera *key*. for values, it will check if
|
|
152
|
+
the interpolation function syntax is correct. Wrong:
|
|
153
|
+
|
|
154
|
+
```yaml
|
|
155
|
+
foo:
|
|
156
|
+
"%{lookup('baz'):3306}": []
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
correct would be:
|
|
160
|
+
|
|
161
|
+
```yaml
|
|
162
|
+
foo:
|
|
163
|
+
"%{lookup('baz')}:3306": []
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
### manifests
|
|
167
|
+
|
|
168
|
+
Checks all `.pp` files in the module for syntax errors.
|
|
169
|
+
|
|
170
|
+
### templates
|
|
171
|
+
|
|
172
|
+
#### erb
|
|
173
|
+
|
|
174
|
+
Checks `.erb` files in the module for syntax errors.
|
|
175
|
+
|
|
176
|
+
#### epp
|
|
177
|
+
|
|
178
|
+
Checks `.epp` files in the module for syntax errors.
|
|
179
|
+
|
|
180
|
+
EPP checks are supported in Puppet 4 or greater, or in Puppet 3 with the future
|
|
181
|
+
parser enabled.
|
|
182
|
+
|
|
183
|
+
## Contributing
|
|
184
|
+
|
|
185
|
+
1. Fork the repo.
|
|
186
|
+
2. Create your feature branch (`git checkout -b my-new-feature`).
|
|
187
|
+
3. Commit your changes (`git commit -am 'Add some feature'`).
|
|
188
|
+
4. Push to the branch (`git push origin my-new-feature`).
|
|
189
|
+
5. Create new Pull Request.
|
|
190
|
+
|
|
191
|
+
## Making a new Release
|
|
192
|
+
|
|
193
|
+
* Update version in `lib/puppetlabs-syntax/version.rb`
|
|
194
|
+
* Run the changelog rake task (bundle exec rake changelog)
|
|
195
|
+
* Create a PR
|
|
196
|
+
* Get it reviewed and merged
|
|
197
|
+
* update the local repo, create a signed git tag, prefixed with a v, matching the new version (git tag -s v1.2.3)
|
|
198
|
+
* GitHub action will publish to GitHub Packages and Rubygems
|
data/Rakefile
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'bundler/gem_tasks'
|
|
4
|
+
require 'rspec/core/rake_task'
|
|
5
|
+
RSpec::Core::RakeTask.new('spec')
|
|
6
|
+
|
|
7
|
+
task default: [:spec]
|
|
8
|
+
begin
|
|
9
|
+
require 'github_changelog_generator/task'
|
|
10
|
+
require 'puppetlabs-syntax/version'
|
|
11
|
+
GitHubChangelogGenerator::RakeTask.new :changelog do |config|
|
|
12
|
+
version = PuppetlabsSyntax::VERSION
|
|
13
|
+
config.future_release = "v#{version}" if /^\d+\.\d+.\d+$/.match?(version)
|
|
14
|
+
config.header = "# Changelog\n\nAll notable changes to this project will be documented in this file."
|
|
15
|
+
config.exclude_labels = %w[duplicate question invalid wontfix wont-fix modulesync skip-changelog github_actions]
|
|
16
|
+
config.user = 'puppetlabs'
|
|
17
|
+
config.project = 'puppetlabs-syntax'
|
|
18
|
+
end
|
|
19
|
+
rescue LoadError
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
begin
|
|
23
|
+
require 'voxpupuli/rubocop/rake'
|
|
24
|
+
rescue LoadError
|
|
25
|
+
# the voxpupuli-rubocop gem is optional
|
|
26
|
+
end
|