puppet-syntax 5.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fa1f289751fd476cf68888ea7332859a070fd13da470cb62e1d3c71d8afc1291
4
- data.tar.gz: 44a4d1f9652ef9b40d1ee6318321073d2a46d393aa4b043aa4bab225db542a2f
3
+ metadata.gz: 6ceebbdcfd034f93f23ad05b4cfee3f46ddca9706f5123575816dd9828a24f18
4
+ data.tar.gz: 86ef711394df9cfbe002775ed6c0f8cd4be2dc9dfa97bf69422a2173f16b13ae
5
5
  SHA512:
6
- metadata.gz: eb28b604491202ead9128626b736462b5aa16761fce9437f45e3d890aecfdaf6737c3d4b823c14864c84b07f425ab642859408dd210fb31d91f81ed6e38db9c8
7
- data.tar.gz: 8830caf03c537c2a229a2686ea5fbfe729d6a73525d1078a27f0b1c0317d13bc81802415ffd3004fa9486486d9df2d9c52bf0d5f941079a83b43a0b30632c76c
6
+ metadata.gz: 5a0420b7318e32b07dc6a7b1a3767fb331e6dff7f93d5be0f472146321564411d893362d9fe7f7b28387d83a84cd9086e275ad72ab417b81a65b43a8ea10dfeb
7
+ data.tar.gz: e5362a07fe65501abc7529c74fd10d21ff2606530ab893c352ec4cba6b640a888ee04f031a9315a981b803caf46e952cc9b2258ee7d30f8f97fb91a90253b8fe
@@ -0,0 +1,41 @@
1
+ ---
2
+ # https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes
3
+
4
+ changelog:
5
+ exclude:
6
+ labels:
7
+ - duplicate
8
+ - invalid
9
+ - modulesync
10
+ - question
11
+ - skip-changelog
12
+ - wont-fix
13
+ - wontfix
14
+ - github_actions
15
+
16
+ categories:
17
+ - title: Breaking Changes 🛠
18
+ labels:
19
+ - backwards-incompatible
20
+
21
+ - title: New Features 🎉
22
+ labels:
23
+ - enhancement
24
+
25
+ - title: Bug Fixes 🐛
26
+ labels:
27
+ - bug
28
+ - bugfix
29
+
30
+ - title: Documentation Updates 📚
31
+ labels:
32
+ - documentation
33
+ - docs
34
+
35
+ - title: Dependency Updates ⬆️
36
+ labels:
37
+ - dependencies
38
+
39
+ - title: Other Changes
40
+ labels:
41
+ - "*"
@@ -1,32 +1,106 @@
1
- name: Release
1
+ ---
2
+ name: Gem Release
2
3
 
3
4
  on:
4
5
  push:
5
6
  tags:
6
7
  - '*'
7
8
 
9
+ permissions: {}
10
+
8
11
  jobs:
9
- release:
10
- runs-on: ubuntu-latest
12
+ build-release:
13
+ # Prevent releases from forked repositories
11
14
  if: github.repository_owner == 'voxpupuli'
15
+ name: Build the gem
16
+ runs-on: ubuntu-24.04
12
17
  steps:
13
- - uses: actions/checkout@v4
14
- - name: Install Ruby 3.1
18
+ - uses: actions/checkout@v5
19
+ - name: Install Ruby
15
20
  uses: ruby/setup-ruby@v1
16
21
  with:
17
- ruby-version: '3.1'
18
- env:
19
- BUNDLE_WITHOUT: release
22
+ ruby-version: 'ruby'
20
23
  - name: Build gem
21
- run: gem build --strict --verbose *.gemspec
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
33
+
34
+ create-github-release:
35
+ needs: build-release
36
+ name: Create GitHub release
37
+ runs-on: ubuntu-24.04
38
+ permissions:
39
+ contents: write # clone repo and create release
40
+ steps:
41
+ - name: Download gem from GitHub cache
42
+ uses: actions/download-artifact@v5
43
+ with:
44
+ name: gem-artifact
45
+ - name: Create Release
46
+ shell: bash
47
+ env:
48
+ GH_TOKEN: ${{ github.token }}
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
64
+ env:
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
22
80
  - name: Publish gem to rubygems.org
81
+ shell: bash
23
82
  run: gem push *.gem
24
- env:
25
- GEM_HOST_API_KEY: '${{ secrets.RUBYGEMS_AUTH_TOKEN }}'
26
- - name: Setup GitHub packages access
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
27
104
  run: |
28
- mkdir -p ~/.gem
29
- echo ":github: Bearer ${{ secrets.GITHUB_TOKEN }}" >> ~/.gem/credentials
30
- chmod 0600 ~/.gem/credentials
31
- - name: Publish gem to GitHub packages
32
- run: gem push --key github --host https://rubygems.pkg.github.com/${{ github.repository_owner }} *.gem
105
+ gem install rubygems-await
106
+ gem await *.gem
@@ -1,3 +1,4 @@
1
+ ---
1
2
  name: Test
2
3
 
3
4
  on:
@@ -8,6 +9,9 @@ on:
8
9
  env:
9
10
  BUNDLE_WITHOUT: development:release
10
11
 
12
+ permissions:
13
+ contents: read
14
+
11
15
  jobs:
12
16
  rubocop_and_matrix:
13
17
  env:
@@ -16,11 +20,11 @@ jobs:
16
20
  outputs:
17
21
  ruby: ${{ steps.ruby.outputs.versions }}
18
22
  steps:
19
- - uses: actions/checkout@v4
23
+ - uses: actions/checkout@v5
20
24
  - name: Install Ruby ${{ matrix.ruby }}
21
25
  uses: ruby/setup-ruby@v1
22
26
  with:
23
- ruby-version: "3.1"
27
+ ruby-version: "3.4"
24
28
  bundler-cache: true
25
29
  - name: Run Rubocop
26
30
  run: bundle exec rake rubocop
@@ -28,7 +32,7 @@ jobs:
28
32
  uses: voxpupuli/ruby-version@v1
29
33
 
30
34
  test:
31
- runs-on: ubuntu-latest
35
+ runs-on: ubuntu-24.04
32
36
  needs: rubocop_and_matrix
33
37
  strategy:
34
38
  fail-fast: false
@@ -36,37 +40,33 @@ jobs:
36
40
  ruby: ${{ fromJSON(needs.rubocop_and_matrix.outputs.ruby) }}
37
41
  puppet:
38
42
  - "~> 8.0"
39
- - "~> 7.0"
40
- - "https://github.com/puppetlabs/puppet.git#main"
41
- exclude:
42
- - ruby: "3.0"
43
- puppet: "~> 8.0"
44
- - ruby: "2.7"
45
- puppet: "~> 8.0"
46
- - ruby: "3.0"
47
- puppet: "https://github.com/puppetlabs/puppet.git#main"
48
- - ruby: "2.7"
49
- puppet: "https://github.com/puppetlabs/puppet.git#main"
50
- name: "Ruby ${{ matrix.ruby }} - Puppet ${{ matrix.puppet }}"
43
+ - "https://github.com/OpenVoxProject/puppet.git#main"
44
+ name: "Ruby ${{ matrix.ruby }} - OpenVox ${{ matrix.puppet }}"
51
45
  env:
52
46
  PUPPET_VERSION: ${{ matrix.puppet }}
53
47
  steps:
54
- - uses: actions/checkout@v4
48
+ - uses: actions/checkout@v5
55
49
  - name: Install Ruby ${{ matrix.ruby }}
56
50
  uses: ruby/setup-ruby@v1
57
51
  with:
58
52
  ruby-version: ${{ matrix.ruby }}
59
53
  bundler-cache: true
54
+ - name: Output Ruby environment
55
+ run: bundle env
60
56
  - name: Run tests
61
57
  run: bundle exec rake
62
58
  - name: Build gem
63
59
  run: gem build --strict --verbose *.gemspec
64
60
 
65
61
  tests:
62
+ if: always()
66
63
  needs:
67
64
  - rubocop_and_matrix
68
65
  - test
69
- runs-on: ubuntu-latest
66
+ runs-on: ubuntu-24.04
70
67
  name: Test suite
71
68
  steps:
72
- - run: echo Test suite completed
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
@@ -6,3 +6,6 @@ inherit_gem:
6
6
 
7
7
  Metrics:
8
8
  Enabled: false
9
+
10
+ AllCops:
11
+ TargetRubyVersion: 3.2
data/.rubocop_todo.yml CHANGED
@@ -1,13 +1,13 @@
1
1
  # This configuration was generated by
2
- # `rubocop --auto-gen-config`
3
- # on 2025-05-09 08:19:08 UTC using RuboCop version 1.67.0.
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: 2
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: 29
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,27 @@
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
+
18
+ ## [v6.0.0](https://github.com/voxpupuli/puppet-syntax/tree/v6.0.0) (2025-06-10)
19
+
20
+ [Full Changelog](https://github.com/voxpupuli/puppet-syntax/compare/v5.0.0...v6.0.0)
21
+
22
+ **Breaking changes:**
23
+
24
+ - Switch from puppet to openvox [\#189](https://github.com/voxpupuli/puppet-syntax/pull/189) ([bastelfreak](https://github.com/bastelfreak))
25
+
5
26
  ## [v5.0.0](https://github.com/voxpupuli/puppet-syntax/tree/v5.0.0) (2025-05-23)
6
27
 
7
28
  [Full Changelog](https://github.com/voxpupuli/puppet-syntax/compare/v4.1.1...v5.0.0)
@@ -27,7 +48,7 @@ All notable changes to this project will be documented in this file.
27
48
 
28
49
  **Fixed bugs:**
29
50
 
30
- - fix too greedy regular expression [\#171](https://github.com/voxpupuli/puppet-syntax/pull/171) ([tmu-sprd](https://github.com/tmu-sprd))
51
+ - fix too greedy regular expression [\#171](https://github.com/voxpupuli/puppet-syntax/pull/171) ([sprd-tmu](https://github.com/sprd-tmu))
31
52
 
32
53
  ## [v4.1.0](https://github.com/voxpupuli/puppet-syntax/tree/v4.1.0) (2024-03-12)
33
54
 
data/Gemfile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source 'https://rubygems.org'
2
4
 
3
5
  # Find a location or specific version for a gem. place_or_version can be a
@@ -19,11 +21,8 @@ gemspec
19
21
 
20
22
  # Override gemspec for CI matrix builds.
21
23
  # But only if the environment variable is set
22
- gem 'puppet', *location_for(ENV['PUPPET_VERSION']) if ENV['PUPPET_VERSION']
24
+ gem 'openvox', *location_for(ENV['PUPPET_VERSION']) if ENV['PUPPET_VERSION']
23
25
  # Puppet on Ruby 3.3 / 3.4 has some missing dependencies
24
- gem 'base64', '~> 0.2' if RUBY_VERSION >= '3.4'
25
- gem 'getoptlong', '~> 0.2' if RUBY_VERSION >= '3.4'
26
- gem 'racc', '~> 1.8' if RUBY_VERSION >= '3.3'
27
26
  gem 'syslog', '~> 0.3' if RUBY_VERSION >= '3.4'
28
27
 
29
28
  group :test do
data/Rakefile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rspec/core/rake_task'
2
4
  RSpec::Core::RakeTask.new('spec')
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'yaml'
2
4
  require 'base64'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module PuppetSyntax
2
4
  class Manifests
3
5
  def check(filelist)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'puppet-syntax'
2
4
  require 'rake'
3
5
  require 'rake/tasklib'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'erb'
2
4
  require 'stringio'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module PuppetSyntax
2
- VERSION = '5.0.0'
4
+ VERSION = '7.0.0'
3
5
  end
data/lib/puppet-syntax.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'puppet-syntax/version'
2
4
 
3
5
  module PuppetSyntax
@@ -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.7'
21
+ spec.required_ruby_version = '>= 3.2'
20
22
 
21
- spec.add_dependency 'puppet', '>= 7', '< 9'
23
+ spec.add_dependency 'openvox', '>= 8', '< 9'
22
24
  spec.add_dependency 'rake', '~> 13.1'
23
25
 
24
- spec.add_development_dependency 'voxpupuli-rubocop', '~> 3.1.0'
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) { PuppetSyntax::Hiera.new }
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) { PuppetSyntax::Manifests.new }
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 eq(false)
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 eq(false)
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 eq(false)
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 eq(true)
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 eq(true)
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 eq(false)
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 eq(false)
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 eq(true)
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 eq(true)
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,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
  require 'puppet-syntax/tasks/puppet-syntax'
3
5
 
@@ -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) { PuppetSyntax::Templates.new }
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/
@@ -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
- PuppetSyntax.exclude_paths = []
7
+ described_class.exclude_paths = []
6
8
  end
7
9
 
8
10
  it 'defaults exclude_paths to include the pkg directory' do
9
- expect(PuppetSyntax.exclude_paths).to include('pkg/**/*')
11
+ expect(described_class.exclude_paths).to include('pkg/**/*')
10
12
  end
11
13
 
12
14
  it 'supports setting exclude_paths' do
13
- PuppetSyntax.exclude_paths = ['foo', 'bar/baz']
14
- expect(PuppetSyntax.exclude_paths).to eq(['foo', 'bar/baz'])
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
- PuppetSyntax.exclude_paths << 'foo'
19
- expect(PuppetSyntax.exclude_paths).to eq(['foo'])
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
- PuppetSyntax.fail_on_deprecation_notices = false
24
- expect(PuppetSyntax.fail_on_deprecation_notices).to eq(false)
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
- PuppetSyntax.epp_only = true
29
- expect(PuppetSyntax.epp_only).to eq(true)
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
- PuppetSyntax.hieradata_paths = []
34
- expect(PuppetSyntax.hieradata_paths).to eq([])
35
- PuppetSyntax.manifests_paths = ['**/environments/production/**/*.pp']
36
- expect(PuppetSyntax.manifests_paths).to eq(['**/environments/production/**/*.pp'])
37
- PuppetSyntax.templates_paths = []
38
- expect(PuppetSyntax.templates_paths).to eq([])
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
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rspec'
2
4
  require 'puppet-syntax'
3
5
 
metadata CHANGED
@@ -1,22 +1,21 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puppet-syntax
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.0
4
+ version: 7.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vox Pupuli
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2025-05-23 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
- name: puppet
13
+ name: openvox
15
14
  requirement: !ruby/object:Gem::Requirement
16
15
  requirements:
17
16
  - - ">="
18
17
  - !ruby/object:Gem::Version
19
- version: '7'
18
+ version: '8'
20
19
  - - "<"
21
20
  - !ruby/object:Gem::Version
22
21
  version: '9'
@@ -26,7 +25,7 @@ dependencies:
26
25
  requirements:
27
26
  - - ">="
28
27
  - !ruby/object:Gem::Version
29
- version: '7'
28
+ version: '8'
30
29
  - - "<"
31
30
  - !ruby/object:Gem::Version
32
31
  version: '9'
@@ -50,14 +49,14 @@ dependencies:
50
49
  requirements:
51
50
  - - "~>"
52
51
  - !ruby/object:Gem::Version
53
- version: 3.1.0
52
+ version: 4.2.0
54
53
  type: :development
55
54
  prerelease: false
56
55
  version_requirements: !ruby/object:Gem::Requirement
57
56
  requirements:
58
57
  - - "~>"
59
58
  - !ruby/object:Gem::Version
60
- version: 3.1.0
59
+ version: 4.2.0
61
60
  description: Syntax checks for Puppet manifests and templates
62
61
  email:
63
62
  - voxpupuli@groups.io
@@ -66,6 +65,7 @@ extensions: []
66
65
  extra_rdoc_files: []
67
66
  files:
68
67
  - ".github/dependabot.yml"
68
+ - ".github/release.yml"
69
69
  - ".github/workflows/release.yml"
70
70
  - ".github/workflows/test.yml"
71
71
  - ".gitignore"
@@ -123,7 +123,6 @@ homepage: https://github.com/voxpupuli/puppet-syntax
123
123
  licenses:
124
124
  - MIT
125
125
  metadata: {}
126
- post_install_message:
127
126
  rdoc_options: []
128
127
  require_paths:
129
128
  - lib
@@ -131,15 +130,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
131
130
  requirements:
132
131
  - - ">="
133
132
  - !ruby/object:Gem::Version
134
- version: '2.7'
133
+ version: '3.2'
135
134
  required_rubygems_version: !ruby/object:Gem::Requirement
136
135
  requirements:
137
136
  - - ">="
138
137
  - !ruby/object:Gem::Version
139
138
  version: '0'
140
139
  requirements: []
141
- rubygems_version: 3.3.27
142
- signing_key:
140
+ rubygems_version: 3.6.9
143
141
  specification_version: 4
144
142
  summary: Syntax checks for Puppet manifests, templates, and Hiera YAML
145
143
  test_files: []