Skip to content

Commit 813544a

Browse files
committed
Update to PDK template 3.2.0
1 parent 6fe98c2 commit 813544a

File tree

6 files changed

+21
-96
lines changed

6 files changed

+21
-96
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: "Publish module"
22

33
on:
44
workflow_dispatch:
5-
5+
66
jobs:
77
release:
88
uses: "puppetlabs/cat-github-actions/.github/workflows/module_release.yml@main"

.rubocop.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ require:
33
- rubocop-performance
44
- rubocop-rspec
55
AllCops:
6+
NewCops: enable
67
DisplayCopNames: true
78
TargetRubyVersion: '2.6'
89
Include:
@@ -37,8 +38,6 @@ Style/BlockDelimiters:
3738
be consistent then.
3839
EnforcedStyle: braces_for_chaining
3940
Style/ClassAndModuleChildren:
40-
Description: Compact style reduces the required amount of indentation.
41-
EnforcedStyle: compact
4241
Enabled: false
4342
Style/EmptyElse:
4443
Description: Enforce against empty else clauses, but allow `nil` for clarity.
@@ -532,6 +531,8 @@ Lint/DuplicateBranch:
532531
Enabled: false
533532
Lint/DuplicateMagicComment:
534533
Enabled: false
534+
Lint/DuplicateMatchPattern:
535+
Enabled: false
535536
Lint/DuplicateRegexpCharacterClassElement:
536537
Enabled: false
537538
Lint/EmptyBlock:
@@ -648,6 +649,8 @@ Style/ComparableClamp:
648649
Enabled: false
649650
Style/ConcatArrayLiterals:
650651
Enabled: false
652+
Style/DataInheritance:
653+
Enabled: false
651654
Style/DirEmpty:
652655
Enabled: false
653656
Style/DocumentDynamicEvalDefinition:
@@ -716,6 +719,8 @@ Style/RedundantHeredocDelimiterQuotes:
716719
Enabled: false
717720
Style/RedundantInitialize:
718721
Enabled: false
722+
Style/RedundantLineContinuation:
723+
Enabled: false
719724
Style/RedundantSelfAssignmentBranch:
720725
Enabled: false
721726
Style/RedundantStringEscape:

.vscode/extensions.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"recommendations": [
33
"puppet.puppet-vscode",
4-
"rebornix.Ruby"
4+
"Shopify.ruby-lsp"
55
]
66
}

Gemfile

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,19 @@ group :development do
2020
gem "json", '= 2.6.1', require: false if Gem::Requirement.create(['>= 3.1.0', '< 3.1.3']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
2121
gem "json", '= 2.6.3', require: false if Gem::Requirement.create(['>= 3.2.0', '< 4.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
2222
gem "racc", '~> 1.4.0', require: false if Gem::Requirement.create(['>= 2.7.0', '< 3.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
23+
gem "deep_merge", '~> 1.0', require: false
2324
gem "voxpupuli-puppet-lint-plugins", '~> 5.0', require: false
2425
gem "facterdb", '~> 1.18', require: false
25-
gem "metadata-json-lint", '~> 3.0', require: false
26-
gem "puppetlabs_spec_helper", '~> 6.0', require: false
27-
gem "rspec-puppet-facts", '~> 2.0', require: false
28-
gem "codecov", '~> 0.2', require: false
26+
gem "metadata-json-lint", '~> 4.0', require: false
27+
gem "rspec-puppet-facts", '~> 3.0', require: false
2928
gem "dependency_checker", '~> 1.0.0', require: false
3029
gem "parallel_tests", '= 3.12.1', require: false
3130
gem "pry", '~> 0.10', require: false
32-
gem "simplecov-console", '~> 0.5', require: false
31+
gem "simplecov-console", '~> 0.9', require: false
3332
gem "puppet-debugger", '~> 1.0', require: false
34-
gem "rubocop", '= 1.48.1', require: false
33+
gem "rubocop", '~> 1.50.0', require: false
3534
gem "rubocop-performance", '= 1.16.0', require: false
3635
gem "rubocop-rspec", '= 2.19.0', require: false
37-
gem "puppet-strings", '~> 4.0', require: false
3836
gem "rb-readline", '= 0.5.5', require: false, platforms: [:mswin, :mingw, :x64_mingw]
3937
gem "beaker", *location_for(ENV['BEAKER_VERSION'] || '~> 6.0')
4038
gem "beaker-abs", *location_for(ENV['BEAKER_ABS_VERSION'] || '~> 1.0')
@@ -48,15 +46,16 @@ group :development do
4846
gem "beaker-task_helper", '~> 1.9', require: false if ENV["GEM_BOLT"]
4947
gem "async", '~> 1.30', require: false
5048
end
49+
group :development, :release_prep do
50+
gem "puppet-strings", '~> 4.0', require: false
51+
gem "puppetlabs_spec_helper", '~> 7.0', require: false
52+
end
5153
group :system_tests do
5254
gem "puppet_litmus", '~> 1.0', require: false, platforms: [:ruby, :x64_mingw]
55+
gem "CFPropertyList", '< 3.0.7', require: false, platforms: [:mswin, :mingw, :x64_mingw]
5356
gem "serverspec", '~> 2.41', require: false
5457
gem "voxpupuli-acceptance", '~> 3', require: false
5558
end
56-
group :release_prep do
57-
gem "puppet-strings", '~> 4.0', require: false
58-
gem "puppetlabs_spec_helper", '~> 6.0', require: false
59-
end
6059

6160
puppet_version = ENV['PUPPET_GEM_VERSION']
6261
facter_version = ENV['FACTER_GEM_VERSION']

Rakefile

Lines changed: 0 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -4,87 +4,8 @@ require 'bundler'
44
require 'puppet_litmus/rake_tasks' if Gem.loaded_specs.key? 'puppet_litmus'
55
require 'puppetlabs_spec_helper/rake_tasks'
66
require 'puppet-syntax/tasks/puppet-syntax'
7-
require 'github_changelog_generator/task' if Gem.loaded_specs.key? 'github_changelog_generator'
87
require 'puppet-strings/tasks' if Gem.loaded_specs.key? 'puppet-strings'
98
require 'voxpupuli/acceptance/rake' if Gem.loaded_specs.key? 'voxpupuli-acceptance'
109

11-
def changelog_user
12-
return unless Rake.application.top_level_tasks.include? "changelog"
13-
returnVal = nil || JSON.load(File.read('metadata.json'))['author']
14-
raise "unable to find the changelog_user in .sync.yml, or the author in metadata.json" if returnVal.nil?
15-
puts "GitHubChangelogGenerator user:#{returnVal}"
16-
returnVal
17-
end
18-
19-
def changelog_project
20-
return unless Rake.application.top_level_tasks.include? "changelog"
21-
22-
returnVal = nil
23-
returnVal ||= begin
24-
metadata_source = JSON.load(File.read('metadata.json'))['source']
25-
metadata_source_match = metadata_source && metadata_source.match(%r{.*\/([^\/]*?)(?:\.git)?\Z})
26-
27-
metadata_source_match && metadata_source_match[1]
28-
end
29-
30-
raise "unable to find the changelog_project in .sync.yml or calculate it from the source in metadata.json" if returnVal.nil?
31-
32-
puts "GitHubChangelogGenerator project:#{returnVal}"
33-
returnVal
34-
end
35-
36-
def changelog_future_release
37-
return unless Rake.application.top_level_tasks.include? "changelog"
38-
returnVal = "v%s" % JSON.load(File.read('metadata.json'))['version']
39-
raise "unable to find the future_release (version) in metadata.json" if returnVal.nil?
40-
puts "GitHubChangelogGenerator future_release:#{returnVal}"
41-
returnVal
42-
end
43-
4410
PuppetLint.configuration.send('disable_relative')
4511
PuppetLint.configuration.send('disable_puppet_url_without_modules')
46-
47-
48-
if Gem.loaded_specs.key? 'github_changelog_generator'
49-
GitHubChangelogGenerator::RakeTask.new :changelog do |config|
50-
raise "Set CHANGELOG_GITHUB_TOKEN environment variable eg 'export CHANGELOG_GITHUB_TOKEN=valid_token_here'" if Rake.application.top_level_tasks.include? "changelog" and ENV['CHANGELOG_GITHUB_TOKEN'].nil?
51-
config.user = "#{changelog_user}"
52-
config.project = "#{changelog_project}"
53-
config.future_release = "#{changelog_future_release}"
54-
config.exclude_labels = ['maintenance']
55-
config.header = "# Change log\n\nAll notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org)."
56-
config.add_pr_wo_labels = true
57-
config.issues = false
58-
config.merge_prefix = "### UNCATEGORIZED PRS; LABEL THEM ON GITHUB"
59-
config.configure_sections = {
60-
"Changed" => {
61-
"prefix" => "### Changed",
62-
"labels" => ["backwards-incompatible"],
63-
},
64-
"Added" => {
65-
"prefix" => "### Added",
66-
"labels" => ["enhancement", "feature"],
67-
},
68-
"Fixed" => {
69-
"prefix" => "### Fixed",
70-
"labels" => ["bug", "documentation", "bugfix"],
71-
},
72-
}
73-
end
74-
else
75-
desc 'Generate a Changelog from GitHub'
76-
task :changelog do
77-
raise <<EOM
78-
The changelog tasks depends on recent features of the github_changelog_generator gem.
79-
Please manually add it to your .sync.yml for now, and run `pdk update`:
80-
---
81-
Gemfile:
82-
optional:
83-
':development':
84-
- gem: 'github_changelog_generator'
85-
version: '~> 1.15'
86-
condition: "Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.3.0')"
87-
EOM
88-
end
89-
end
90-

metadata.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,6 @@
7676
}
7777
],
7878
"pdk-version": "3.2.0",
79-
"template-url": "https://github.com/puppetlabs/pdk-templates#3.0.1",
80-
"template-ref": "tags/3.0.1-0-gd13288a"
79+
"template-url": "https://github.com/puppetlabs/pdk-templates#3.2.0",
80+
"template-ref": "tags/3.2.0-0-gb257ef1"
8181
}

0 commit comments

Comments
 (0)