puppet-syntax 3.3.0 → 4.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/dependabot.yml +17 -0
- data/.github/workflows/release.yml +2 -2
- data/.github/workflows/test.yml +31 -29
- data/.rubocop.yml +8 -0
- data/.rubocop_todo.yml +252 -0
- data/CHANGELOG.md +46 -0
- data/Gemfile +7 -6
- data/README.md +4 -3
- data/Rakefile +14 -3
- data/lib/puppet-syntax/hiera.rb +43 -43
- data/lib/puppet-syntax/manifests.rb +14 -14
- data/lib/puppet-syntax/tasks/puppet-syntax.rb +12 -11
- data/lib/puppet-syntax/templates.rb +14 -15
- data/lib/puppet-syntax/version.rb +1 -1
- data/lib/puppet-syntax.rb +6 -6
- data/puppet-syntax.gemspec +16 -16
- data/spec/puppet-syntax/hiera_spec.rb +13 -15
- data/spec/puppet-syntax/manifests_spec.rb +13 -14
- data/spec/puppet-syntax/tasks/puppet-syntax_spec.rb +4 -4
- data/spec/puppet-syntax/templates_spec.rb +18 -18
- data/spec/puppet-syntax_spec.rb +12 -12
- metadata +43 -56
- data/spec/fixtures/hiera/hiera_bad_18.yaml +0 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 00b51658a2b442427a7acac7c712fb3188d90a66c3d328c5d719b2034b11ad3c
|
4
|
+
data.tar.gz: 33d7cea4918830fd06b91ce02feab1617eaf50a5554cec8d28e59deaff836cd5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: daf199345270be08621d083a76ce169a089dee282a74ebc6de9475c89c36dbef95da3ccf9aac8e4121c267c3d079064e1d0de6f7701a74a4d4d9132b9bb1da72
|
7
|
+
data.tar.gz: 395e92778f90d03e941bf9cd67957cf65fc7ce47cac3816a951f9752e569f6056600a3fa3f42944b086d6e8256ad2596af2bf534f7f3e59fb0d8925f4ba36b3f
|
@@ -0,0 +1,17 @@
|
|
1
|
+
version: 2
|
2
|
+
updates:
|
3
|
+
# raise PRs for gem updates
|
4
|
+
- package-ecosystem: bundler
|
5
|
+
directory: "/"
|
6
|
+
schedule:
|
7
|
+
interval: daily
|
8
|
+
time: "13:00"
|
9
|
+
open-pull-requests-limit: 10
|
10
|
+
|
11
|
+
# Maintain dependencies for GitHub Actions
|
12
|
+
- package-ecosystem: github-actions
|
13
|
+
directory: "/"
|
14
|
+
schedule:
|
15
|
+
interval: daily
|
16
|
+
time: "13:00"
|
17
|
+
open-pull-requests-limit: 10
|
@@ -10,7 +10,7 @@ jobs:
|
|
10
10
|
runs-on: ubuntu-latest
|
11
11
|
if: github.repository_owner == 'voxpupuli'
|
12
12
|
steps:
|
13
|
-
- uses: actions/checkout@
|
13
|
+
- uses: actions/checkout@v4
|
14
14
|
- name: Install Ruby 3.1
|
15
15
|
uses: ruby/setup-ruby@v1
|
16
16
|
with:
|
@@ -18,7 +18,7 @@ jobs:
|
|
18
18
|
env:
|
19
19
|
BUNDLE_WITHOUT: release
|
20
20
|
- name: Build gem
|
21
|
-
run: gem build *.gemspec
|
21
|
+
run: gem build --strict --verbose *.gemspec
|
22
22
|
- name: Publish gem to rubygems.org
|
23
23
|
run: gem push *.gem
|
24
24
|
env:
|
data/.github/workflows/test.yml
CHANGED
@@ -9,56 +9,47 @@ env:
|
|
9
9
|
BUNDLE_WITHOUT: development:release
|
10
10
|
|
11
11
|
jobs:
|
12
|
+
rubocop:
|
13
|
+
env:
|
14
|
+
BUNDLE_WITHOUT: release
|
15
|
+
runs-on: ubuntu-latest
|
16
|
+
steps:
|
17
|
+
- uses: actions/checkout@v4
|
18
|
+
- name: Install Ruby ${{ matrix.ruby }}
|
19
|
+
uses: ruby/setup-ruby@v1
|
20
|
+
with:
|
21
|
+
ruby-version: "3.1"
|
22
|
+
bundler-cache: true
|
23
|
+
- name: Run Rubocop
|
24
|
+
run: bundle exec rake rubocop
|
12
25
|
test:
|
13
26
|
runs-on: ubuntu-latest
|
14
27
|
strategy:
|
15
28
|
fail-fast: false
|
16
29
|
matrix:
|
17
30
|
ruby:
|
31
|
+
- "3.2"
|
18
32
|
- "3.1"
|
19
33
|
- "3.0"
|
20
34
|
- "2.7"
|
21
|
-
- "2.6"
|
22
|
-
- "2.5"
|
23
|
-
- "2.4"
|
24
35
|
puppet:
|
36
|
+
- "~> 8.0"
|
25
37
|
- "~> 7.0"
|
26
|
-
- "~> 6.29"
|
27
|
-
- "~> 5.5.10"
|
28
38
|
- "https://github.com/puppetlabs/puppet.git#main"
|
29
39
|
exclude:
|
30
|
-
- ruby: "2.6"
|
31
|
-
puppet: "~> 7.0"
|
32
|
-
- ruby: "2.5"
|
33
|
-
puppet: "~> 7.0"
|
34
|
-
- ruby: "2.4"
|
35
|
-
puppet: "~> 7.0"
|
36
|
-
|
37
|
-
- ruby: "3.1"
|
38
|
-
puppet: "~> 6.29"
|
39
40
|
- ruby: "3.0"
|
40
|
-
puppet: "~>
|
41
|
-
|
42
|
-
- ruby: "3.1"
|
43
|
-
puppet: "~> 5.5.10"
|
44
|
-
- ruby: "3.0"
|
45
|
-
puppet: "~> 5.5.10"
|
41
|
+
puppet: "~> 8.0"
|
46
42
|
- ruby: "2.7"
|
47
|
-
puppet: "~>
|
48
|
-
- ruby: "
|
49
|
-
puppet: "~> 5.5.10"
|
50
|
-
|
51
|
-
- ruby: "2.6"
|
52
|
-
puppet: "https://github.com/puppetlabs/puppet.git#main"
|
53
|
-
- ruby: "2.5"
|
43
|
+
puppet: "~> 8.0"
|
44
|
+
- ruby: "3.0"
|
54
45
|
puppet: "https://github.com/puppetlabs/puppet.git#main"
|
55
|
-
- ruby: "2.
|
46
|
+
- ruby: "2.7"
|
56
47
|
puppet: "https://github.com/puppetlabs/puppet.git#main"
|
57
48
|
name: "Ruby ${{ matrix.ruby }} - Puppet ${{ matrix.puppet }}"
|
58
49
|
env:
|
59
50
|
PUPPET_VERSION: ${{ matrix.puppet }}
|
60
51
|
steps:
|
61
|
-
- uses: actions/checkout@
|
52
|
+
- uses: actions/checkout@v4
|
62
53
|
- name: Install Ruby ${{ matrix.ruby }}
|
63
54
|
uses: ruby/setup-ruby@v1
|
64
55
|
with:
|
@@ -66,3 +57,14 @@ jobs:
|
|
66
57
|
bundler-cache: true
|
67
58
|
- name: Run tests
|
68
59
|
run: bundle exec rake
|
60
|
+
- name: Build gem
|
61
|
+
run: gem build --strict --verbose *.gemspec
|
62
|
+
|
63
|
+
tests:
|
64
|
+
needs:
|
65
|
+
- rubocop
|
66
|
+
- test
|
67
|
+
runs-on: ubuntu-latest
|
68
|
+
name: Test suite
|
69
|
+
steps:
|
70
|
+
- run: echo Test suite completed
|
data/.rubocop.yml
ADDED
data/.rubocop_todo.yml
ADDED
@@ -0,0 +1,252 @@
|
|
1
|
+
# This configuration was generated by
|
2
|
+
# `rubocop --auto-gen-config`
|
3
|
+
# on 2024-03-08 12:59:05 UTC using RuboCop version 1.61.0.
|
4
|
+
# The point is for the user to remove these configuration records
|
5
|
+
# one by one as the offenses are removed from the code base.
|
6
|
+
# Note that changes in the inspected code, or installation of new
|
7
|
+
# versions of RuboCop, may require this file to be generated again.
|
8
|
+
|
9
|
+
# Offense count: 2
|
10
|
+
# Configuration parameters: IgnoreLiteralBranches, IgnoreConstantBranches.
|
11
|
+
Lint/DuplicateBranch:
|
12
|
+
Exclude:
|
13
|
+
- 'lib/puppet-syntax/templates.rb'
|
14
|
+
|
15
|
+
# Offense count: 1
|
16
|
+
# Configuration parameters: AllowedParentClasses.
|
17
|
+
Lint/MissingSuper:
|
18
|
+
Exclude:
|
19
|
+
- 'lib/puppet-syntax/tasks/puppet-syntax.rb'
|
20
|
+
|
21
|
+
# Offense count: 1
|
22
|
+
Lint/RescueException:
|
23
|
+
Exclude:
|
24
|
+
- 'lib/puppet-syntax/hiera.rb'
|
25
|
+
|
26
|
+
# Offense count: 1
|
27
|
+
# Configuration parameters: AllowComments, AllowNil.
|
28
|
+
Lint/SuppressedException:
|
29
|
+
Exclude:
|
30
|
+
- 'Rakefile'
|
31
|
+
|
32
|
+
# Offense count: 1
|
33
|
+
# This cop supports unsafe autocorrection (--autocorrect-all).
|
34
|
+
# Configuration parameters: AutoCorrect.
|
35
|
+
Lint/UselessAssignment:
|
36
|
+
Exclude:
|
37
|
+
- 'lib/puppet-syntax/templates.rb'
|
38
|
+
|
39
|
+
# Offense count: 4
|
40
|
+
# Configuration parameters: ExpectMatchingDefinition, CheckDefinitionPathHierarchy, CheckDefinitionPathHierarchyRoots, Regex, IgnoreExecutableScripts, AllowedAcronyms.
|
41
|
+
# CheckDefinitionPathHierarchyRoots: lib, spec, test, src
|
42
|
+
# AllowedAcronyms: CLI, DSL, ACL, API, ASCII, CPU, CSS, DNS, EOF, GUID, HTML, HTTP, HTTPS, ID, IP, JSON, LHS, QPS, RAM, RHS, RPC, SLA, SMTP, SQL, SSH, TCP, TLS, TTL, UDP, UI, UID, UUID, URI, URL, UTF8, VM, XML, XMPP, XSRF, XSS
|
43
|
+
Naming/FileName:
|
44
|
+
Exclude:
|
45
|
+
- 'lib/puppet-syntax.rb'
|
46
|
+
- 'lib/puppet-syntax/tasks/puppet-syntax.rb'
|
47
|
+
- 'spec/puppet-syntax/tasks/puppet-syntax_spec.rb'
|
48
|
+
- 'spec/puppet-syntax_spec.rb'
|
49
|
+
|
50
|
+
# Offense count: 11
|
51
|
+
# This cop supports unsafe autocorrection (--autocorrect-all).
|
52
|
+
RSpec/BeEq:
|
53
|
+
Exclude:
|
54
|
+
- 'spec/puppet-syntax/manifests_spec.rb'
|
55
|
+
- 'spec/puppet-syntax_spec.rb'
|
56
|
+
|
57
|
+
# Offense count: 1
|
58
|
+
# Configuration parameters: Prefixes, AllowedPatterns.
|
59
|
+
# Prefixes: when, with, without
|
60
|
+
RSpec/ContextWording:
|
61
|
+
Exclude:
|
62
|
+
- 'spec/puppet-syntax/hiera_spec.rb'
|
63
|
+
|
64
|
+
# Offense count: 1
|
65
|
+
# Configuration parameters: IgnoredMetadata.
|
66
|
+
RSpec/DescribeClass:
|
67
|
+
Exclude:
|
68
|
+
- '**/spec/features/**/*'
|
69
|
+
- '**/spec/requests/**/*'
|
70
|
+
- '**/spec/routing/**/*'
|
71
|
+
- '**/spec/system/**/*'
|
72
|
+
- '**/spec/views/**/*'
|
73
|
+
- 'spec/puppet-syntax/tasks/puppet-syntax_spec.rb'
|
74
|
+
|
75
|
+
# Offense count: 19
|
76
|
+
# This cop supports unsafe autocorrection (--autocorrect-all).
|
77
|
+
# Configuration parameters: SkipBlocks, EnforcedStyle, OnlyStaticConstants.
|
78
|
+
# SupportedStyles: described_class, explicit
|
79
|
+
RSpec/DescribedClass:
|
80
|
+
Exclude:
|
81
|
+
- 'spec/puppet-syntax/hiera_spec.rb'
|
82
|
+
- 'spec/puppet-syntax/manifests_spec.rb'
|
83
|
+
- 'spec/puppet-syntax/templates_spec.rb'
|
84
|
+
- 'spec/puppet-syntax_spec.rb'
|
85
|
+
|
86
|
+
# Offense count: 7
|
87
|
+
# Configuration parameters: CountAsOne.
|
88
|
+
RSpec/ExampleLength:
|
89
|
+
Max: 14
|
90
|
+
|
91
|
+
# Offense count: 4
|
92
|
+
# Configuration parameters: Include, CustomTransform, IgnoreMethods, SpecSuffixOnly.
|
93
|
+
# Include: **/*_spec*rb*, **/spec/**/*
|
94
|
+
RSpec/FilePath:
|
95
|
+
Exclude:
|
96
|
+
- 'spec/puppet-syntax/hiera_spec.rb'
|
97
|
+
- 'spec/puppet-syntax/manifests_spec.rb'
|
98
|
+
- 'spec/puppet-syntax/templates_spec.rb'
|
99
|
+
- 'spec/puppet-syntax_spec.rb'
|
100
|
+
|
101
|
+
# Offense count: 29
|
102
|
+
RSpec/MultipleExpectations:
|
103
|
+
Max: 8
|
104
|
+
|
105
|
+
# Offense count: 30
|
106
|
+
# Configuration parameters: EnforcedStyle, IgnoreSharedExamples.
|
107
|
+
# SupportedStyles: always, named_only
|
108
|
+
RSpec/NamedSubject:
|
109
|
+
Exclude:
|
110
|
+
- 'spec/puppet-syntax/hiera_spec.rb'
|
111
|
+
- 'spec/puppet-syntax/manifests_spec.rb'
|
112
|
+
- 'spec/puppet-syntax/templates_spec.rb'
|
113
|
+
|
114
|
+
# Offense count: 8
|
115
|
+
RSpec/RepeatedDescription:
|
116
|
+
Exclude:
|
117
|
+
- 'spec/puppet-syntax/templates_spec.rb'
|
118
|
+
|
119
|
+
# Offense count: 4
|
120
|
+
# Configuration parameters: Include, CustomTransform, IgnoreMethods, IgnoreMetadata.
|
121
|
+
# Include: **/*_spec.rb
|
122
|
+
RSpec/SpecFilePathFormat:
|
123
|
+
Exclude:
|
124
|
+
- '**/spec/routing/**/*'
|
125
|
+
- 'spec/puppet-syntax/hiera_spec.rb'
|
126
|
+
- 'spec/puppet-syntax/manifests_spec.rb'
|
127
|
+
- 'spec/puppet-syntax/templates_spec.rb'
|
128
|
+
- 'spec/puppet-syntax_spec.rb'
|
129
|
+
|
130
|
+
# Offense count: 3
|
131
|
+
RSpec/SubjectDeclaration:
|
132
|
+
Exclude:
|
133
|
+
- 'spec/puppet-syntax/hiera_spec.rb'
|
134
|
+
- 'spec/puppet-syntax/manifests_spec.rb'
|
135
|
+
- 'spec/puppet-syntax/templates_spec.rb'
|
136
|
+
|
137
|
+
# Offense count: 1
|
138
|
+
# This cop supports safe autocorrection (--autocorrect).
|
139
|
+
Rake/Desc:
|
140
|
+
Exclude:
|
141
|
+
- 'Rakefile'
|
142
|
+
|
143
|
+
# Offense count: 1
|
144
|
+
# This cop supports unsafe autocorrection (--autocorrect-all).
|
145
|
+
# Configuration parameters: EnforcedStyle.
|
146
|
+
# SupportedStyles: always, conditionals
|
147
|
+
Style/AndOr:
|
148
|
+
Exclude:
|
149
|
+
- 'lib/puppet-syntax/templates.rb'
|
150
|
+
|
151
|
+
# Offense count: 1
|
152
|
+
# This cop supports unsafe autocorrection (--autocorrect-all).
|
153
|
+
# Configuration parameters: MinBranchesCount.
|
154
|
+
Style/CaseLikeIf:
|
155
|
+
Exclude:
|
156
|
+
- 'lib/puppet-syntax/hiera.rb'
|
157
|
+
|
158
|
+
# Offense count: 5
|
159
|
+
# Configuration parameters: AllowedConstants.
|
160
|
+
Style/Documentation:
|
161
|
+
Exclude:
|
162
|
+
- 'spec/**/*'
|
163
|
+
- 'test/**/*'
|
164
|
+
- 'lib/puppet-syntax.rb'
|
165
|
+
- 'lib/puppet-syntax/hiera.rb'
|
166
|
+
- 'lib/puppet-syntax/manifests.rb'
|
167
|
+
- 'lib/puppet-syntax/tasks/puppet-syntax.rb'
|
168
|
+
- 'lib/puppet-syntax/templates.rb'
|
169
|
+
|
170
|
+
# Offense count: 15
|
171
|
+
# This cop supports unsafe autocorrection (--autocorrect-all).
|
172
|
+
# Configuration parameters: EnforcedStyle.
|
173
|
+
# SupportedStyles: always, always_true, never
|
174
|
+
Style/FrozenStringLiteralComment:
|
175
|
+
Exclude:
|
176
|
+
- 'Gemfile'
|
177
|
+
- 'Rakefile'
|
178
|
+
- 'lib/puppet-syntax.rb'
|
179
|
+
- 'lib/puppet-syntax/hiera.rb'
|
180
|
+
- 'lib/puppet-syntax/manifests.rb'
|
181
|
+
- 'lib/puppet-syntax/tasks/puppet-syntax.rb'
|
182
|
+
- 'lib/puppet-syntax/templates.rb'
|
183
|
+
- 'lib/puppet-syntax/version.rb'
|
184
|
+
- 'puppet-syntax.gemspec'
|
185
|
+
- 'spec/puppet-syntax/hiera_spec.rb'
|
186
|
+
- 'spec/puppet-syntax/manifests_spec.rb'
|
187
|
+
- 'spec/puppet-syntax/tasks/puppet-syntax_spec.rb'
|
188
|
+
- 'spec/puppet-syntax/templates_spec.rb'
|
189
|
+
- 'spec/puppet-syntax_spec.rb'
|
190
|
+
- 'spec/spec_helper.rb'
|
191
|
+
|
192
|
+
# Offense count: 2
|
193
|
+
# This cop supports unsafe autocorrection (--autocorrect-all).
|
194
|
+
Style/IdenticalConditionalBranches:
|
195
|
+
Exclude:
|
196
|
+
- 'lib/puppet-syntax/templates.rb'
|
197
|
+
|
198
|
+
# Offense count: 1
|
199
|
+
# This cop supports unsafe autocorrection (--autocorrect-all).
|
200
|
+
# Configuration parameters: EnforcedStyle.
|
201
|
+
# SupportedStyles: literals, strict
|
202
|
+
Style/MutableConstant:
|
203
|
+
Exclude:
|
204
|
+
- 'lib/puppet-syntax/version.rb'
|
205
|
+
|
206
|
+
# Offense count: 1
|
207
|
+
# This cop supports unsafe autocorrection (--autocorrect-all).
|
208
|
+
# Configuration parameters: EnforcedStyle, AllowedMethods, AllowedPatterns.
|
209
|
+
# SupportedStyles: predicate, comparison
|
210
|
+
Style/NumericPredicate:
|
211
|
+
Exclude:
|
212
|
+
- 'spec/**/*'
|
213
|
+
- 'lib/puppet-syntax/hiera.rb'
|
214
|
+
|
215
|
+
# Offense count: 1
|
216
|
+
# This cop supports safe autocorrection (--autocorrect).
|
217
|
+
# Configuration parameters: EnforcedStyle, AllowInnerSlashes.
|
218
|
+
# SupportedStyles: slashes, percent_r, mixed
|
219
|
+
Style/RegexpLiteral:
|
220
|
+
Exclude:
|
221
|
+
- 'spec/puppet-syntax/templates_spec.rb'
|
222
|
+
|
223
|
+
# Offense count: 1
|
224
|
+
# This cop supports unsafe autocorrection (--autocorrect-all).
|
225
|
+
Style/SelectByRegexp:
|
226
|
+
Exclude:
|
227
|
+
- 'lib/puppet-syntax/manifests.rb'
|
228
|
+
|
229
|
+
# Offense count: 1
|
230
|
+
# This cop supports unsafe autocorrection (--autocorrect-all).
|
231
|
+
# Configuration parameters: RequireEnglish, EnforcedStyle.
|
232
|
+
# SupportedStyles: use_perl_names, use_english_names, use_builtin_english_names
|
233
|
+
Style/SpecialGlobalVars:
|
234
|
+
Exclude:
|
235
|
+
- 'puppet-syntax.gemspec'
|
236
|
+
|
237
|
+
# Offense count: 4
|
238
|
+
# This cop supports unsafe autocorrection (--autocorrect-all).
|
239
|
+
# Configuration parameters: AllowMethodsWithArguments, AllowedMethods, AllowedPatterns, AllowComments.
|
240
|
+
# AllowedMethods: define_method
|
241
|
+
Style/SymbolProc:
|
242
|
+
Exclude:
|
243
|
+
- 'lib/puppet-syntax/hiera.rb'
|
244
|
+
- 'lib/puppet-syntax/manifests.rb'
|
245
|
+
- 'lib/puppet-syntax/templates.rb'
|
246
|
+
|
247
|
+
# Offense count: 2
|
248
|
+
# This cop supports safe autocorrection (--autocorrect).
|
249
|
+
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns.
|
250
|
+
# URISchemes: http, https
|
251
|
+
Layout/LineLength:
|
252
|
+
Max: 211
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,52 @@
|
|
2
2
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
|
5
|
+
## [v4.0.1](https://github.com/voxpupuli/puppet-syntax/tree/v4.0.1) (2024-03-12)
|
6
|
+
|
7
|
+
[Full Changelog](https://github.com/voxpupuli/puppet-syntax/compare/v4.0.0...v4.0.1)
|
8
|
+
|
9
|
+
**Fixed bugs:**
|
10
|
+
|
11
|
+
- Raise warning if hiera check is called but disabled [\#165](https://github.com/voxpupuli/puppet-syntax/pull/165) ([bastelfreak](https://github.com/bastelfreak))
|
12
|
+
|
13
|
+
**Merged pull requests:**
|
14
|
+
|
15
|
+
- Drop Puppet 5.4 check [\#166](https://github.com/voxpupuli/puppet-syntax/pull/166) ([bastelfreak](https://github.com/bastelfreak))
|
16
|
+
- README.md: Update required Puppet/Ruby versions [\#164](https://github.com/voxpupuli/puppet-syntax/pull/164) ([bastelfreak](https://github.com/bastelfreak))
|
17
|
+
- 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))
|
18
|
+
|
19
|
+
## [v4.0.0](https://github.com/voxpupuli/puppet-syntax/tree/v4.0.0) (2024-02-07)
|
20
|
+
|
21
|
+
[Full Changelog](https://github.com/voxpupuli/puppet-syntax/compare/v3.3.0...v4.0.0)
|
22
|
+
|
23
|
+
**Breaking changes:**
|
24
|
+
|
25
|
+
- 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))
|
26
|
+
|
27
|
+
**Implemented enhancements:**
|
28
|
+
|
29
|
+
- Add Ruby 3.2 / Puppet 8 support [\#147](https://github.com/voxpupuli/puppet-syntax/pull/147) ([bastelfreak](https://github.com/bastelfreak))
|
30
|
+
- support aliases in hiera yaml [\#144](https://github.com/voxpupuli/puppet-syntax/pull/144) ([akerl](https://github.com/akerl))
|
31
|
+
- Implement RuboCop [\#137](https://github.com/voxpupuli/puppet-syntax/pull/137) ([bastelfreak](https://github.com/bastelfreak))
|
32
|
+
|
33
|
+
**Fixed bugs:**
|
34
|
+
|
35
|
+
- fix "NameError: uninitialized constant Puppet::Util" [\#155](https://github.com/voxpupuli/puppet-syntax/pull/155) ([mxey](https://github.com/mxey))
|
36
|
+
- add all known hiera-eyaml methods [\#154](https://github.com/voxpupuli/puppet-syntax/pull/154) ([mxey](https://github.com/mxey))
|
37
|
+
|
38
|
+
**Merged pull requests:**
|
39
|
+
|
40
|
+
- README.md: Fix badges [\#161](https://github.com/voxpupuli/puppet-syntax/pull/161) ([bastelfreak](https://github.com/bastelfreak))
|
41
|
+
- 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))
|
42
|
+
- 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))
|
43
|
+
- 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))
|
44
|
+
- GCG: Add faraday-retry dep [\#149](https://github.com/voxpupuli/puppet-syntax/pull/149) ([bastelfreak](https://github.com/bastelfreak))
|
45
|
+
- Switch to voxpupuli-rubocop [\#148](https://github.com/voxpupuli/puppet-syntax/pull/148) ([bastelfreak](https://github.com/bastelfreak))
|
46
|
+
- CI: add dummy job to depend on [\#146](https://github.com/voxpupuli/puppet-syntax/pull/146) ([bastelfreak](https://github.com/bastelfreak))
|
47
|
+
- Drop Ruby 1.8 testcode [\#142](https://github.com/voxpupuli/puppet-syntax/pull/142) ([bastelfreak](https://github.com/bastelfreak))
|
48
|
+
- rubocop: fix whitespace and newline warnings [\#141](https://github.com/voxpupuli/puppet-syntax/pull/141) ([bastelfreak](https://github.com/bastelfreak))
|
49
|
+
- rubocop: fix trailing comma [\#140](https://github.com/voxpupuli/puppet-syntax/pull/140) ([bastelfreak](https://github.com/bastelfreak))
|
50
|
+
|
5
51
|
## [v3.3.0](https://github.com/voxpupuli/puppet-syntax/tree/v3.3.0) (2023-02-08)
|
6
52
|
|
7
53
|
[Full Changelog](https://github.com/voxpupuli/puppet-syntax/compare/v3.2.1...v3.3.0)
|
data/Gemfile
CHANGED
@@ -6,11 +6,11 @@ source 'https://rubygems.org'
|
|
6
6
|
# is specified as `file://some/location/on/disk`.
|
7
7
|
def location_for(place_or_version, fake_version = nil)
|
8
8
|
if place_or_version =~ /^(https[:@][^#]*)#(.*)/
|
9
|
-
[fake_version, { :
|
10
|
-
elsif place_or_version =~
|
11
|
-
['>= 0', { :
|
9
|
+
[fake_version, { git: Regexp.last_match(1), branch: Regexp.last_match(2), require: false }].compact
|
10
|
+
elsif place_or_version =~ %r{^file://(.*)}
|
11
|
+
['>= 0', { path: File.expand_path(Regexp.last_match(1)), require: false }]
|
12
12
|
else
|
13
|
-
[place_or_version, { :
|
13
|
+
[place_or_version, { require: false }]
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
@@ -25,6 +25,7 @@ group :test do
|
|
25
25
|
gem 'rspec'
|
26
26
|
end
|
27
27
|
|
28
|
-
group :release do
|
29
|
-
gem '
|
28
|
+
group :release, optional: true do
|
29
|
+
gem 'faraday-retry', '~> 2.1', require: false
|
30
|
+
gem 'github_changelog_generator', '~> 1.16.4', require: false
|
30
31
|
end
|
data/README.md
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
# puppet-syntax
|
2
2
|
|
3
3
|
[![License](https://img.shields.io/github/license/voxpupuli/puppet-syntax.svg)](https://github.com/voxpupuli/puppet-syntax/blob/master/LICENSE.txt)
|
4
|
-
[![Release](https://github.com/voxpupuli/puppet-syntax/actions/workflows/
|
4
|
+
[![Release](https://github.com/voxpupuli/puppet-syntax/actions/workflows/release.yml/badge.svg)](https://github.com/voxpupuli/puppet-syntax/actions/workflows/release.yml)
|
5
|
+
[![Test](https://github.com/voxpupuli/puppet-syntax/actions/workflows/test.yml/badge.svg)](https://github.com/voxpupuli/puppet-syntax/actions/workflows/test.yml)
|
5
6
|
[![RubyGem Version](https://img.shields.io/gem/v/puppet-syntax.svg)](https://rubygems.org/gems/puppet-syntax)
|
6
7
|
[![RubyGem Downloads](https://img.shields.io/gem/dt/puppet-syntax.svg)](https://rubygems.org/gems/puppet-syntax)
|
7
8
|
|
@@ -14,8 +15,8 @@ Hiera YAML.
|
|
14
15
|
|
15
16
|
Puppet::Syntax is supported with:
|
16
17
|
|
17
|
-
- Puppet >=
|
18
|
-
- Ruby >= 2.
|
18
|
+
- Puppet >= 7.0
|
19
|
+
- Ruby >= 2.7
|
19
20
|
|
20
21
|
For the specific versions that we test against, see the [GitHub Actions workflow](.github/workflows/test.yml).
|
21
22
|
|
data/Rakefile
CHANGED
@@ -7,17 +7,28 @@ task :publish_gem do
|
|
7
7
|
puts "Published #{gem}" if gem
|
8
8
|
end
|
9
9
|
|
10
|
-
task :
|
10
|
+
task default: [:spec]
|
11
11
|
begin
|
12
12
|
require 'github_changelog_generator/task'
|
13
13
|
require 'puppet-syntax/version'
|
14
14
|
GitHubChangelogGenerator::RakeTask.new :changelog do |config|
|
15
15
|
version = PuppetSyntax::VERSION
|
16
|
-
config.future_release = "v#{version}" if
|
16
|
+
config.future_release = "v#{version}" if /^\d+\.\d+.\d+$/.match?(version)
|
17
17
|
config.header = "# Changelog\n\nAll notable changes to this project will be documented in this file."
|
18
|
-
config.exclude_labels = %w
|
18
|
+
config.exclude_labels = %w[duplicate question invalid wontfix wont-fix modulesync skip-changelog github_actions]
|
19
19
|
config.user = 'voxpupuli'
|
20
20
|
config.project = 'puppet-syntax'
|
21
21
|
end
|
22
22
|
rescue LoadError
|
23
23
|
end
|
24
|
+
|
25
|
+
begin
|
26
|
+
require 'rubocop/rake_task'
|
27
|
+
rescue LoadError
|
28
|
+
# RuboCop is an optional group
|
29
|
+
else
|
30
|
+
RuboCop::RakeTask.new(:rubocop) do |task|
|
31
|
+
# These make the rubocop experience maybe slightly less terrible
|
32
|
+
task.options = ['--display-cop-names', '--display-style-guide', '--extra-details']
|
33
|
+
end
|
34
|
+
end
|
data/lib/puppet-syntax/hiera.rb
CHANGED
@@ -3,21 +3,20 @@ require 'base64'
|
|
3
3
|
|
4
4
|
module PuppetSyntax
|
5
5
|
class Hiera
|
6
|
-
|
7
6
|
def check_hiera_key(key)
|
8
7
|
if key.is_a? Symbol
|
9
8
|
if key.to_s.start_with?(':')
|
10
|
-
|
11
|
-
elsif
|
12
|
-
|
13
|
-
end
|
14
|
-
elsif key !~ /^[a-z][a-z0-9_]+(::[a-z][a-z0-9_]+)*$/
|
15
|
-
if key =~ /[^:]:[^:]/
|
16
|
-
# be extra helpful
|
17
|
-
return "Looks like a missing colon"
|
18
|
-
else
|
19
|
-
return "Not a valid Puppet variable name for automatic lookup"
|
9
|
+
"Puppet automatic lookup will not use leading '::'"
|
10
|
+
elsif !/^[a-z]+$/.match?(key) # we allow Hiera's own configuration
|
11
|
+
'Puppet automatic lookup will not look up symbols'
|
20
12
|
end
|
13
|
+
elsif !/^[a-z][a-z0-9_]+(::[a-z][a-z0-9_]+)*$/.match?(key)
|
14
|
+
return 'Looks like a missing colon' if /[^:]:[^:]/.match?(key)
|
15
|
+
|
16
|
+
# be extra helpful
|
17
|
+
|
18
|
+
'Not a valid Puppet variable name for automatic lookup'
|
19
|
+
|
21
20
|
end
|
22
21
|
end
|
23
22
|
|
@@ -33,7 +32,7 @@ module PuppetSyntax
|
|
33
32
|
break if error
|
34
33
|
end
|
35
34
|
elsif val.is_a? Hash
|
36
|
-
val.each do |k,v|
|
35
|
+
val.each do |k, v|
|
37
36
|
error = check_eyaml_data("#{name}['#{k}']", v)
|
38
37
|
break if error
|
39
38
|
end
|
@@ -42,53 +41,54 @@ module PuppetSyntax
|
|
42
41
|
end
|
43
42
|
|
44
43
|
def check_eyaml_blob(val)
|
45
|
-
return unless
|
44
|
+
return unless /^ENC\[/.match?(val)
|
46
45
|
|
47
46
|
val.sub!('ENC[', '')
|
48
47
|
val.gsub!(/\s+/, '')
|
49
|
-
|
50
|
-
return "has unterminated eyaml value"
|
51
|
-
else
|
52
|
-
val.sub!(/\]$/, '')
|
53
|
-
method, base64 = val.split(/,/)
|
54
|
-
if base64 == nil
|
55
|
-
base64 = method
|
56
|
-
method = 'PKCS7'
|
57
|
-
end
|
58
|
-
|
59
|
-
return "has unknown eyaml method #{method}" unless ['PKCS7','GPG','GKMS','KMS'].include? method
|
60
|
-
return "has unpadded or truncated base64 data" unless base64.length % 4 == 0
|
48
|
+
return 'has unterminated eyaml value' unless /\]$/.match?(val)
|
61
49
|
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
end
|
50
|
+
val.sub!(/\]$/, '')
|
51
|
+
method, base64 = val.split(',')
|
52
|
+
if base64.nil?
|
53
|
+
base64 = method
|
54
|
+
method = 'PKCS7'
|
68
55
|
end
|
56
|
+
|
57
|
+
known_methods = %w[PKCS7 GPG GKMS KMS TWOFAC SecretBox VAULT GCPKMS RSA SSHAGENT VAULT_RS cli]
|
58
|
+
return "has unknown eyaml method #{method}" unless known_methods.include? method
|
59
|
+
return 'has unpadded or truncated base64 data' unless base64.length % 4 == 0
|
60
|
+
|
61
|
+
# Base64#decode64 will silently ignore characters outside the alphabet,
|
62
|
+
# so we check resulting length of binary data instead
|
63
|
+
pad_length = base64.gsub(/[^=]/, '').length
|
64
|
+
return unless Base64.decode64(base64).length != (base64.length * 3 / 4) - pad_length
|
65
|
+
|
66
|
+
'has corrupt base64 data'
|
69
67
|
end
|
70
68
|
|
71
69
|
def check(filelist)
|
72
|
-
raise
|
70
|
+
raise 'Expected an array of files' unless filelist.is_a?(Array)
|
73
71
|
|
74
72
|
errors = []
|
75
73
|
|
74
|
+
yamlargs = (Psych::VERSION >= '4.0') ? { aliases: true } : {}
|
75
|
+
|
76
76
|
filelist.each do |hiera_file|
|
77
77
|
begin
|
78
|
-
yamldata = YAML.load_file(hiera_file)
|
79
|
-
rescue Exception =>
|
80
|
-
errors << "ERROR: Failed to parse #{hiera_file}: #{
|
78
|
+
yamldata = YAML.load_file(hiera_file, **yamlargs)
|
79
|
+
rescue Exception => e
|
80
|
+
errors << "ERROR: Failed to parse #{hiera_file}: #{e}"
|
81
81
|
next
|
82
82
|
end
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
eyaml_msg = check_eyaml_data(k, v)
|
90
|
-
errors << "WARNING: #{hiera_file}: #{eyaml_msg}" if eyaml_msg
|
83
|
+
next unless yamldata
|
84
|
+
|
85
|
+
yamldata.each do |k, v|
|
86
|
+
if PuppetSyntax.check_hiera_keys
|
87
|
+
key_msg = check_hiera_key(k)
|
88
|
+
errors << "WARNING: #{hiera_file}: Key :#{k}: #{key_msg}" if key_msg
|
91
89
|
end
|
90
|
+
eyaml_msg = check_eyaml_data(k, v)
|
91
|
+
errors << "WARNING: #{hiera_file}: #{eyaml_msg}" if eyaml_msg
|
92
92
|
end
|
93
93
|
end
|
94
94
|
|