puppet-syntax 6.0.0 → 7.0.0
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/.github/release.yml +1 -0
- data/.github/workflows/release.yml +90 -23
- data/.github/workflows/test.yml +9 -19
- data/.rubocop.yml +3 -0
- data/.rubocop_todo.yml +6 -64
- data/CHANGELOG.md +14 -1
- data/Gemfile +2 -0
- data/Rakefile +2 -0
- data/lib/puppet-syntax/hiera.rb +2 -0
- data/lib/puppet-syntax/manifests.rb +2 -0
- data/lib/puppet-syntax/tasks/puppet-syntax.rb +2 -0
- data/lib/puppet-syntax/templates.rb +2 -0
- data/lib/puppet-syntax/version.rb +3 -1
- data/lib/puppet-syntax.rb +2 -0
- data/puppet-syntax.gemspec +5 -3
- data/spec/puppet-syntax/hiera_spec.rb +3 -1
- data/spec/puppet-syntax/manifests_spec.rb +12 -10
- data/spec/puppet-syntax/tasks/puppet-syntax_spec.rb +2 -0
- data/spec/puppet-syntax/templates_spec.rb +3 -1
- data/spec/puppet-syntax_spec.rb +18 -16
- data/spec/spec_helper.rb +2 -0
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6ceebbdcfd034f93f23ad05b4cfee3f46ddca9706f5123575816dd9828a24f18
|
4
|
+
data.tar.gz: 86ef711394df9cfbe002775ed6c0f8cd4be2dc9dfa97bf69422a2173f16b13ae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5a0420b7318e32b07dc6a7b1a3767fb331e6dff7f93d5be0f472146321564411d893362d9fe7f7b28387d83a84cd9086e275ad72ab417b81a65b43a8ea10dfeb
|
7
|
+
data.tar.gz: e5362a07fe65501abc7529c74fd10d21ff2606530ab893c352ec4cba6b640a888ee04f031a9315a981b803caf46e952cc9b2258ee7d30f8f97fb91a90253b8fe
|
data/.github/release.yml
CHANGED
@@ -1,39 +1,106 @@
|
|
1
1
|
---
|
2
|
-
name: Release
|
2
|
+
name: Gem Release
|
3
3
|
|
4
4
|
on:
|
5
5
|
push:
|
6
6
|
tags:
|
7
7
|
- '*'
|
8
8
|
|
9
|
+
permissions: {}
|
10
|
+
|
9
11
|
jobs:
|
10
|
-
release:
|
11
|
-
|
12
|
-
environment: release
|
12
|
+
build-release:
|
13
|
+
# Prevent releases from forked repositories
|
13
14
|
if: github.repository_owner == 'voxpupuli'
|
15
|
+
name: Build the gem
|
16
|
+
runs-on: ubuntu-24.04
|
17
|
+
steps:
|
18
|
+
- uses: actions/checkout@v5
|
19
|
+
- name: Install Ruby
|
20
|
+
uses: ruby/setup-ruby@v1
|
21
|
+
with:
|
22
|
+
ruby-version: 'ruby'
|
23
|
+
- name: Build gem
|
24
|
+
shell: bash
|
25
|
+
run: gem build --verbose *.gemspec
|
26
|
+
- name: Upload gem to GitHub cache
|
27
|
+
uses: actions/upload-artifact@v4
|
28
|
+
with:
|
29
|
+
name: gem-artifact
|
30
|
+
path: '*.gem'
|
31
|
+
retention-days: 1
|
32
|
+
compression-level: 0
|
14
33
|
|
15
|
-
|
34
|
+
create-github-release:
|
35
|
+
needs: build-release
|
36
|
+
name: Create GitHub release
|
37
|
+
runs-on: ubuntu-24.04
|
16
38
|
permissions:
|
17
|
-
|
18
|
-
contents: write
|
19
|
-
packages: write
|
20
|
-
|
39
|
+
contents: write # clone repo and create release
|
21
40
|
steps:
|
22
|
-
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
chmod 0600 ~/.gem/credentials
|
28
|
-
- name: Publish gem to GitHub packages
|
29
|
-
run: gem push --key github --host https://rubygems.pkg.github.com/${{ github.repository_owner }} *.gem
|
30
|
-
- name: Create Release Page
|
41
|
+
- name: Download gem from GitHub cache
|
42
|
+
uses: actions/download-artifact@v5
|
43
|
+
with:
|
44
|
+
name: gem-artifact
|
45
|
+
- name: Create Release
|
31
46
|
shell: bash
|
32
47
|
env:
|
33
48
|
GH_TOKEN: ${{ github.token }}
|
34
|
-
run: gh release create ${{ github.ref_name }} --generate-notes
|
35
|
-
|
36
|
-
|
49
|
+
run: gh release create --repo ${{ github.repository }} ${{ github.ref_name }} --generate-notes *.gem
|
50
|
+
|
51
|
+
release-to-github:
|
52
|
+
needs: build-release
|
53
|
+
name: Release to GitHub
|
54
|
+
runs-on: ubuntu-24.04
|
55
|
+
permissions:
|
56
|
+
packages: write # publish to rubygems.pkg.github.com
|
57
|
+
steps:
|
58
|
+
- name: Download gem from GitHub cache
|
59
|
+
uses: actions/download-artifact@v5
|
60
|
+
with:
|
61
|
+
name: gem-artifact
|
62
|
+
- name: Publish gem to GitHub packages
|
63
|
+
run: gem push --host https://rubygems.pkg.github.com/${{ github.repository_owner }} *.gem
|
37
64
|
env:
|
38
|
-
|
39
|
-
|
65
|
+
GEM_HOST_API_KEY: ${{ secrets.GITHUB_TOKEN }}
|
66
|
+
|
67
|
+
release-to-rubygems:
|
68
|
+
needs: build-release
|
69
|
+
name: Release gem to rubygems.org
|
70
|
+
runs-on: ubuntu-24.04
|
71
|
+
environment: release # recommended by rubygems.org
|
72
|
+
permissions:
|
73
|
+
id-token: write # rubygems.org authentication
|
74
|
+
steps:
|
75
|
+
- name: Download gem from GitHub cache
|
76
|
+
uses: actions/download-artifact@v5
|
77
|
+
with:
|
78
|
+
name: gem-artifact
|
79
|
+
- uses: rubygems/configure-rubygems-credentials@v1.0.0
|
80
|
+
- name: Publish gem to rubygems.org
|
81
|
+
shell: bash
|
82
|
+
run: gem push *.gem
|
83
|
+
|
84
|
+
release-verification:
|
85
|
+
name: Check that all releases are done
|
86
|
+
runs-on: ubuntu-24.04
|
87
|
+
permissions:
|
88
|
+
contents: read # minimal permissions that we have to grant
|
89
|
+
needs:
|
90
|
+
- create-github-release
|
91
|
+
- release-to-github
|
92
|
+
- release-to-rubygems
|
93
|
+
steps:
|
94
|
+
- name: Download gem from GitHub cache
|
95
|
+
uses: actions/download-artifact@v5
|
96
|
+
with:
|
97
|
+
name: gem-artifact
|
98
|
+
- name: Install Ruby
|
99
|
+
uses: ruby/setup-ruby@v1
|
100
|
+
with:
|
101
|
+
ruby-version: 'ruby'
|
102
|
+
- name: Wait for release to propagate
|
103
|
+
shell: bash
|
104
|
+
run: |
|
105
|
+
gem install rubygems-await
|
106
|
+
gem await *.gem
|
data/.github/workflows/test.yml
CHANGED
@@ -20,11 +20,11 @@ jobs:
|
|
20
20
|
outputs:
|
21
21
|
ruby: ${{ steps.ruby.outputs.versions }}
|
22
22
|
steps:
|
23
|
-
- uses: actions/checkout@
|
23
|
+
- uses: actions/checkout@v5
|
24
24
|
- name: Install Ruby ${{ matrix.ruby }}
|
25
25
|
uses: ruby/setup-ruby@v1
|
26
26
|
with:
|
27
|
-
ruby-version: "3.
|
27
|
+
ruby-version: "3.4"
|
28
28
|
bundler-cache: true
|
29
29
|
- name: Run Rubocop
|
30
30
|
run: bundle exec rake rubocop
|
@@ -40,26 +40,12 @@ jobs:
|
|
40
40
|
ruby: ${{ fromJSON(needs.rubocop_and_matrix.outputs.ruby) }}
|
41
41
|
puppet:
|
42
42
|
- "~> 8.0"
|
43
|
-
- "~> 7.0"
|
44
43
|
- "https://github.com/OpenVoxProject/puppet.git#main"
|
45
|
-
exclude:
|
46
|
-
- ruby: '3.3'
|
47
|
-
puppet: '~> 7.0'
|
48
|
-
- ruby: '3.4'
|
49
|
-
puppet: '~> 7.0'
|
50
|
-
- ruby: "3.0"
|
51
|
-
puppet: "~> 8.0"
|
52
|
-
- ruby: "2.7"
|
53
|
-
puppet: "~> 8.0"
|
54
|
-
- ruby: "3.0"
|
55
|
-
puppet: "https://github.com/OpenVoxProject/puppet.git#main"
|
56
|
-
- ruby: "2.7"
|
57
|
-
puppet: "https://github.com/OpenVoxProject/puppet.git#main"
|
58
44
|
name: "Ruby ${{ matrix.ruby }} - OpenVox ${{ matrix.puppet }}"
|
59
45
|
env:
|
60
46
|
PUPPET_VERSION: ${{ matrix.puppet }}
|
61
47
|
steps:
|
62
|
-
- uses: actions/checkout@
|
48
|
+
- uses: actions/checkout@v5
|
63
49
|
- name: Install Ruby ${{ matrix.ruby }}
|
64
50
|
uses: ruby/setup-ruby@v1
|
65
51
|
with:
|
@@ -73,10 +59,14 @@ jobs:
|
|
73
59
|
run: gem build --strict --verbose *.gemspec
|
74
60
|
|
75
61
|
tests:
|
62
|
+
if: always()
|
76
63
|
needs:
|
77
64
|
- rubocop_and_matrix
|
78
65
|
- test
|
79
|
-
runs-on: ubuntu-
|
66
|
+
runs-on: ubuntu-24.04
|
80
67
|
name: Test suite
|
81
68
|
steps:
|
82
|
-
-
|
69
|
+
- name: Decide whether the needed jobs succeeded or failed
|
70
|
+
uses: re-actors/alls-green@release/v1
|
71
|
+
with:
|
72
|
+
jobs: ${{ toJSON(needs) }}
|
data/.rubocop.yml
CHANGED
data/.rubocop_todo.yml
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
# This configuration was generated by
|
2
|
-
# `rubocop --auto-gen-config`
|
3
|
-
#
|
2
|
+
# `rubocop --auto-gen-config --no-auto-gen-timestamp`
|
3
|
+
# using RuboCop version 1.79.2.
|
4
4
|
# The point is for the user to remove these configuration records
|
5
5
|
# one by one as the offenses are removed from the code base.
|
6
6
|
# Note that changes in the inspected code, or installation of new
|
7
7
|
# versions of RuboCop, may require this file to be generated again.
|
8
8
|
|
9
|
-
# Offense count:
|
10
|
-
# Configuration parameters: IgnoreLiteralBranches, IgnoreConstantBranches.
|
9
|
+
# Offense count: 1
|
10
|
+
# Configuration parameters: IgnoreLiteralBranches, IgnoreConstantBranches, IgnoreDuplicateElseBranch.
|
11
11
|
Lint/DuplicateBranch:
|
12
12
|
Exclude:
|
13
13
|
- 'lib/puppet-syntax/templates.rb'
|
@@ -41,13 +41,6 @@ Naming/FileName:
|
|
41
41
|
- 'spec/puppet-syntax/tasks/puppet-syntax_spec.rb'
|
42
42
|
- 'spec/puppet-syntax_spec.rb'
|
43
43
|
|
44
|
-
# Offense count: 11
|
45
|
-
# This cop supports unsafe autocorrection (--autocorrect-all).
|
46
|
-
RSpec/BeEq:
|
47
|
-
Exclude:
|
48
|
-
- 'spec/puppet-syntax/manifests_spec.rb'
|
49
|
-
- 'spec/puppet-syntax_spec.rb'
|
50
|
-
|
51
44
|
# Offense count: 1
|
52
45
|
# Configuration parameters: Prefixes, AllowedPatterns.
|
53
46
|
# Prefixes: when, with, without
|
@@ -66,27 +59,12 @@ RSpec/DescribeClass:
|
|
66
59
|
- '**/spec/views/**/*'
|
67
60
|
- 'spec/puppet-syntax/tasks/puppet-syntax_spec.rb'
|
68
61
|
|
69
|
-
# Offense count: 19
|
70
|
-
# This cop supports unsafe autocorrection (--autocorrect-all).
|
71
|
-
# Configuration parameters: SkipBlocks, EnforcedStyle, OnlyStaticConstants.
|
72
|
-
# SupportedStyles: described_class, explicit
|
73
|
-
RSpec/DescribedClass:
|
74
|
-
Exclude:
|
75
|
-
- 'spec/puppet-syntax/hiera_spec.rb'
|
76
|
-
- 'spec/puppet-syntax/manifests_spec.rb'
|
77
|
-
- 'spec/puppet-syntax/templates_spec.rb'
|
78
|
-
- 'spec/puppet-syntax_spec.rb'
|
79
|
-
|
80
62
|
# Offense count: 7
|
81
63
|
# Configuration parameters: CountAsOne.
|
82
64
|
RSpec/ExampleLength:
|
83
65
|
Max: 17
|
84
66
|
|
85
|
-
# Offense count:
|
86
|
-
RSpec/MultipleExpectations:
|
87
|
-
Max: 11
|
88
|
-
|
89
|
-
# Offense count: 30
|
67
|
+
# Offense count: 31
|
90
68
|
# Configuration parameters: EnforcedStyle, IgnoreSharedExamples.
|
91
69
|
# SupportedStyles: always, named_only
|
92
70
|
RSpec/NamedSubject:
|
@@ -145,42 +123,6 @@ Style/Documentation:
|
|
145
123
|
- 'lib/puppet-syntax/tasks/puppet-syntax.rb'
|
146
124
|
- 'lib/puppet-syntax/templates.rb'
|
147
125
|
|
148
|
-
# Offense count: 15
|
149
|
-
# This cop supports unsafe autocorrection (--autocorrect-all).
|
150
|
-
# Configuration parameters: EnforcedStyle.
|
151
|
-
# SupportedStyles: always, always_true, never
|
152
|
-
Style/FrozenStringLiteralComment:
|
153
|
-
Exclude:
|
154
|
-
- 'Gemfile'
|
155
|
-
- 'Rakefile'
|
156
|
-
- 'lib/puppet-syntax.rb'
|
157
|
-
- 'lib/puppet-syntax/hiera.rb'
|
158
|
-
- 'lib/puppet-syntax/manifests.rb'
|
159
|
-
- 'lib/puppet-syntax/tasks/puppet-syntax.rb'
|
160
|
-
- 'lib/puppet-syntax/templates.rb'
|
161
|
-
- 'lib/puppet-syntax/version.rb'
|
162
|
-
- 'puppet-syntax.gemspec'
|
163
|
-
- 'spec/puppet-syntax/hiera_spec.rb'
|
164
|
-
- 'spec/puppet-syntax/manifests_spec.rb'
|
165
|
-
- 'spec/puppet-syntax/tasks/puppet-syntax_spec.rb'
|
166
|
-
- 'spec/puppet-syntax/templates_spec.rb'
|
167
|
-
- 'spec/puppet-syntax_spec.rb'
|
168
|
-
- 'spec/spec_helper.rb'
|
169
|
-
|
170
|
-
# Offense count: 2
|
171
|
-
# This cop supports unsafe autocorrection (--autocorrect-all).
|
172
|
-
Style/IdenticalConditionalBranches:
|
173
|
-
Exclude:
|
174
|
-
- 'lib/puppet-syntax/templates.rb'
|
175
|
-
|
176
|
-
# Offense count: 1
|
177
|
-
# This cop supports unsafe autocorrection (--autocorrect-all).
|
178
|
-
# Configuration parameters: EnforcedStyle.
|
179
|
-
# SupportedStyles: literals, strict
|
180
|
-
Style/MutableConstant:
|
181
|
-
Exclude:
|
182
|
-
- 'lib/puppet-syntax/version.rb'
|
183
|
-
|
184
126
|
# Offense count: 1
|
185
127
|
# This cop supports unsafe autocorrection (--autocorrect-all).
|
186
128
|
# Configuration parameters: EnforcedStyle, AllowedMethods, AllowedPatterns.
|
@@ -224,7 +166,7 @@ Style/SymbolProc:
|
|
224
166
|
|
225
167
|
# Offense count: 4
|
226
168
|
# This cop supports safe autocorrection (--autocorrect).
|
227
|
-
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns.
|
169
|
+
# Configuration parameters: AllowHeredoc, AllowURI, AllowQualifiedName, URISchemes, IgnoreCopDirectives, AllowedPatterns, SplitStrings.
|
228
170
|
# URISchemes: http, https
|
229
171
|
Layout/LineLength:
|
230
172
|
Max: 211
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,19 @@
|
|
2
2
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
|
5
|
+
## [v7.0.0](https://github.com/voxpupuli/puppet-syntax/tree/v7.0.0) (2025-08-13)
|
6
|
+
|
7
|
+
[Full Changelog](https://github.com/voxpupuli/puppet-syntax/compare/v6.0.0...v7.0.0)
|
8
|
+
|
9
|
+
**Breaking changes:**
|
10
|
+
|
11
|
+
- Require Ruby 3.2 / OpenVox 8 [\#195](https://github.com/voxpupuli/puppet-syntax/pull/195) ([bastelfreak](https://github.com/bastelfreak))
|
12
|
+
- Require Ruby \>= 3.1 [\#186](https://github.com/voxpupuli/puppet-syntax/pull/186) ([bastelfreak](https://github.com/bastelfreak))
|
13
|
+
|
14
|
+
**Implemented enhancements:**
|
15
|
+
|
16
|
+
- CI: Use Vox Pupuli release defaults [\#194](https://github.com/voxpupuli/puppet-syntax/pull/194) ([bastelfreak](https://github.com/bastelfreak))
|
17
|
+
|
5
18
|
## [v6.0.0](https://github.com/voxpupuli/puppet-syntax/tree/v6.0.0) (2025-06-10)
|
6
19
|
|
7
20
|
[Full Changelog](https://github.com/voxpupuli/puppet-syntax/compare/v5.0.0...v6.0.0)
|
@@ -35,7 +48,7 @@ All notable changes to this project will be documented in this file.
|
|
35
48
|
|
36
49
|
**Fixed bugs:**
|
37
50
|
|
38
|
-
- fix too greedy regular expression [\#171](https://github.com/voxpupuli/puppet-syntax/pull/171) ([tmu
|
51
|
+
- fix too greedy regular expression [\#171](https://github.com/voxpupuli/puppet-syntax/pull/171) ([sprd-tmu](https://github.com/sprd-tmu))
|
39
52
|
|
40
53
|
## [v4.1.0](https://github.com/voxpupuli/puppet-syntax/tree/v4.1.0) (2024-03-12)
|
41
54
|
|
data/Gemfile
CHANGED
data/Rakefile
CHANGED
data/lib/puppet-syntax/hiera.rb
CHANGED
data/lib/puppet-syntax.rb
CHANGED
data/puppet-syntax.gemspec
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
lib = File.expand_path('lib', __dir__)
|
2
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
5
|
require 'puppet-syntax/version'
|
@@ -16,10 +18,10 @@ Gem::Specification.new do |spec|
|
|
16
18
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
17
19
|
spec.require_paths = ['lib']
|
18
20
|
|
19
|
-
spec.required_ruby_version = '>= 2
|
21
|
+
spec.required_ruby_version = '>= 3.2'
|
20
22
|
|
21
|
-
spec.add_dependency 'openvox', '>=
|
23
|
+
spec.add_dependency 'openvox', '>= 8', '< 9'
|
22
24
|
spec.add_dependency 'rake', '~> 13.1'
|
23
25
|
|
24
|
-
spec.add_development_dependency 'voxpupuli-rubocop', '~>
|
26
|
+
spec.add_development_dependency 'voxpupuli-rubocop', '~> 4.2.0'
|
25
27
|
end
|
@@ -1,7 +1,9 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'spec_helper'
|
2
4
|
|
3
5
|
describe PuppetSyntax::Hiera do
|
4
|
-
let(:subject) {
|
6
|
+
let(:subject) { described_class.new }
|
5
7
|
|
6
8
|
it 'expects an array of files' do
|
7
9
|
expect { subject.check(nil) }.to raise_error(/Expected an array of files/)
|
@@ -1,8 +1,10 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'spec_helper'
|
2
4
|
require 'puppet'
|
3
5
|
|
4
6
|
describe PuppetSyntax::Manifests do
|
5
|
-
let(:subject) {
|
7
|
+
let(:subject) { described_class.new }
|
6
8
|
|
7
9
|
it 'expects an array of files' do
|
8
10
|
expect { subject.check(nil) }.to raise_error(/Expected an array of files/)
|
@@ -13,7 +15,7 @@ describe PuppetSyntax::Manifests do
|
|
13
15
|
output, has_errors = subject.check(files)
|
14
16
|
|
15
17
|
expect(output).to eq([])
|
16
|
-
expect(has_errors).to
|
18
|
+
expect(has_errors).to be(false)
|
17
19
|
end
|
18
20
|
|
19
21
|
it 'returns nothing from a valid file with a class using tag parameter' do
|
@@ -21,7 +23,7 @@ describe PuppetSyntax::Manifests do
|
|
21
23
|
output, has_errors = subject.check(files)
|
22
24
|
|
23
25
|
expect(output).to eq([])
|
24
|
-
expect(has_errors).to
|
26
|
+
expect(has_errors).to be(false)
|
25
27
|
end
|
26
28
|
|
27
29
|
it 'returns nothing from a valid file with a class using schedule parameter' do
|
@@ -29,7 +31,7 @@ describe PuppetSyntax::Manifests do
|
|
29
31
|
output, has_errors = subject.check(files)
|
30
32
|
|
31
33
|
expect(output).to eq([])
|
32
|
-
expect(has_errors).to
|
34
|
+
expect(has_errors).to be(false)
|
33
35
|
end
|
34
36
|
|
35
37
|
it 'returns an error from an invalid file' do
|
@@ -38,7 +40,7 @@ describe PuppetSyntax::Manifests do
|
|
38
40
|
|
39
41
|
expect(output.size).to eq(3)
|
40
42
|
expect(output[2]).to match(/2 errors. Giving up/)
|
41
|
-
expect(has_errors).to
|
43
|
+
expect(has_errors).to be(true)
|
42
44
|
end
|
43
45
|
|
44
46
|
it 'returns a warning from an invalid file' do
|
@@ -46,7 +48,7 @@ describe PuppetSyntax::Manifests do
|
|
46
48
|
output, has_errors = subject.check(files)
|
47
49
|
|
48
50
|
expect(output.size).to eq(2)
|
49
|
-
expect(has_errors).to
|
51
|
+
expect(has_errors).to be(true)
|
50
52
|
|
51
53
|
expect(output[0]).to match(/Unrecogni(s|z)ed escape sequence '\\\['/)
|
52
54
|
expect(output[1]).to match(/Unrecogni(s|z)ed escape sequence '\\\]'/)
|
@@ -57,7 +59,7 @@ describe PuppetSyntax::Manifests do
|
|
57
59
|
output, has_errors = subject.check(files)
|
58
60
|
|
59
61
|
expect(output).to eq([])
|
60
|
-
expect(has_errors).to
|
62
|
+
expect(has_errors).to be(false)
|
61
63
|
end
|
62
64
|
|
63
65
|
it 'reads more than one valid file' do
|
@@ -65,14 +67,14 @@ describe PuppetSyntax::Manifests do
|
|
65
67
|
output, has_errors = subject.check(files)
|
66
68
|
|
67
69
|
expect(output).to eq([])
|
68
|
-
expect(has_errors).to
|
70
|
+
expect(has_errors).to be(false)
|
69
71
|
end
|
70
72
|
|
71
73
|
it 'continues after finding an error in the first file' do
|
72
74
|
files = fixture_manifests(['fail_error.pp', 'fail_warning.pp'])
|
73
75
|
output, has_errors = subject.check(files)
|
74
76
|
|
75
|
-
expect(has_errors).to
|
77
|
+
expect(has_errors).to be(true)
|
76
78
|
expect(output.size).to eq(5)
|
77
79
|
expect(output[0]).to match(%r{This Name has no effect. A Host Class Definition can not end with a value-producing expression without other effect \(file: \S*/fail_error.pp, line: 2, column: 32\)$})
|
78
80
|
expect(output[1]).to match(%r{This Name has no effect. A value was produced and then forgotten \(one or more preceding expressions may have the wrong form\) \(file: \S*/fail_error.pp, line: 2, column: 3\)$})
|
@@ -86,7 +88,7 @@ describe PuppetSyntax::Manifests do
|
|
86
88
|
files = fixture_manifests('deprecation_notice.pp')
|
87
89
|
output, has_errors = subject.check(files)
|
88
90
|
|
89
|
-
expect(has_errors).to
|
91
|
+
expect(has_errors).to be(true)
|
90
92
|
expect(output.size).to eq(1)
|
91
93
|
expect(output[0]).to match(/Node inheritance is not supported in Puppet >= 4.0.0/)
|
92
94
|
end
|
@@ -1,7 +1,9 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'spec_helper'
|
2
4
|
|
3
5
|
describe PuppetSyntax::Templates do
|
4
|
-
let(:subject) {
|
6
|
+
let(:subject) { described_class.new }
|
5
7
|
let(:conditional_warning_regex) do
|
6
8
|
# ruby 3.4 uses '= ,ruby 2.6 to 3.3 uses `=
|
7
9
|
/2: warning: found [`']= literal' in conditional/
|
data/spec/puppet-syntax_spec.rb
CHANGED
@@ -1,40 +1,42 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'spec_helper'
|
2
4
|
|
3
5
|
describe PuppetSyntax do
|
4
6
|
after do
|
5
|
-
|
7
|
+
described_class.exclude_paths = []
|
6
8
|
end
|
7
9
|
|
8
10
|
it 'defaults exclude_paths to include the pkg directory' do
|
9
|
-
expect(
|
11
|
+
expect(described_class.exclude_paths).to include('pkg/**/*')
|
10
12
|
end
|
11
13
|
|
12
14
|
it 'supports setting exclude_paths' do
|
13
|
-
|
14
|
-
expect(
|
15
|
+
described_class.exclude_paths = ['foo', 'bar/baz']
|
16
|
+
expect(described_class.exclude_paths).to eq(['foo', 'bar/baz'])
|
15
17
|
end
|
16
18
|
|
17
19
|
it 'supports appending exclude_paths' do
|
18
|
-
|
19
|
-
expect(
|
20
|
+
described_class.exclude_paths << 'foo'
|
21
|
+
expect(described_class.exclude_paths).to eq(['foo'])
|
20
22
|
end
|
21
23
|
|
22
24
|
it 'supports a fail_on_deprecation_notices setting' do
|
23
|
-
|
24
|
-
expect(
|
25
|
+
described_class.fail_on_deprecation_notices = false
|
26
|
+
expect(described_class.fail_on_deprecation_notices).to be(false)
|
25
27
|
end
|
26
28
|
|
27
29
|
it 'supports forcing EPP only templates' do
|
28
|
-
|
29
|
-
expect(
|
30
|
+
described_class.epp_only = true
|
31
|
+
expect(described_class.epp_only).to be(true)
|
30
32
|
end
|
31
33
|
|
32
34
|
it 'supports setting paths for manifests, templates and hiera' do
|
33
|
-
|
34
|
-
expect(
|
35
|
-
|
36
|
-
expect(
|
37
|
-
|
38
|
-
expect(
|
35
|
+
described_class.hieradata_paths = []
|
36
|
+
expect(described_class.hieradata_paths).to eq([])
|
37
|
+
described_class.manifests_paths = ['**/environments/production/**/*.pp']
|
38
|
+
expect(described_class.manifests_paths).to eq(['**/environments/production/**/*.pp'])
|
39
|
+
described_class.templates_paths = []
|
40
|
+
expect(described_class.templates_paths).to eq([])
|
39
41
|
end
|
40
42
|
end
|
data/spec/spec_helper.rb
CHANGED
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:
|
4
|
+
version: 7.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vox Pupuli
|
@@ -15,7 +15,7 @@ dependencies:
|
|
15
15
|
requirements:
|
16
16
|
- - ">="
|
17
17
|
- !ruby/object:Gem::Version
|
18
|
-
version: '
|
18
|
+
version: '8'
|
19
19
|
- - "<"
|
20
20
|
- !ruby/object:Gem::Version
|
21
21
|
version: '9'
|
@@ -25,7 +25,7 @@ dependencies:
|
|
25
25
|
requirements:
|
26
26
|
- - ">="
|
27
27
|
- !ruby/object:Gem::Version
|
28
|
-
version: '
|
28
|
+
version: '8'
|
29
29
|
- - "<"
|
30
30
|
- !ruby/object:Gem::Version
|
31
31
|
version: '9'
|
@@ -49,14 +49,14 @@ dependencies:
|
|
49
49
|
requirements:
|
50
50
|
- - "~>"
|
51
51
|
- !ruby/object:Gem::Version
|
52
|
-
version:
|
52
|
+
version: 4.2.0
|
53
53
|
type: :development
|
54
54
|
prerelease: false
|
55
55
|
version_requirements: !ruby/object:Gem::Requirement
|
56
56
|
requirements:
|
57
57
|
- - "~>"
|
58
58
|
- !ruby/object:Gem::Version
|
59
|
-
version:
|
59
|
+
version: 4.2.0
|
60
60
|
description: Syntax checks for Puppet manifests and templates
|
61
61
|
email:
|
62
62
|
- voxpupuli@groups.io
|
@@ -130,14 +130,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
130
130
|
requirements:
|
131
131
|
- - ">="
|
132
132
|
- !ruby/object:Gem::Version
|
133
|
-
version: '2
|
133
|
+
version: '3.2'
|
134
134
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
136
|
- - ">="
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: '0'
|
139
139
|
requirements: []
|
140
|
-
rubygems_version: 3.6.
|
140
|
+
rubygems_version: 3.6.9
|
141
141
|
specification_version: 4
|
142
142
|
summary: Syntax checks for Puppet manifests, templates, and Hiera YAML
|
143
143
|
test_files: []
|