Skip to content

Commit a0098a4

Browse files
committed
(CAT-1608) - PDK update
1 parent cb21d0b commit a0098a4

File tree

8 files changed

+22
-21
lines changed

8 files changed

+22
-21
lines changed

.rubocop.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ require:
55
- rubocop-performance
66
- rubocop-rspec
77
AllCops:
8+
NewCops: enable
89
DisplayCopNames: true
910
TargetRubyVersion: '2.6'
1011
Include:

.rubocop_todo.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,6 @@
66
# Note that changes in the inspected code, or installation of new
77
# versions of RuboCop, may require this file to be generated again.
88

9-
# Offense count: 6
10-
# This cop supports safe autocorrection (--autocorrect).
11-
Lint/RedundantCopDisableDirective:
12-
Exclude:
13-
- 'lib/puppet/provider/apt_key/apt_key.rb'
14-
- 'spec/unit/puppet/provider/apt_key_spec.rb'
159

1610
# Offense count: 204
1711
# Configuration parameters: EnforcedStyle, IgnoreSharedExamples.

Gemfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ group :development do
1919
gem "json", '= 2.5.1', require: false if Gem::Requirement.create(['>= 3.0.0', '< 3.0.5']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
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))
22+
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))
2223
gem "voxpupuli-puppet-lint-plugins", '~> 5.0', require: false
2324
gem "facterdb", '~> 1.18', require: false
2425
gem "metadata-json-lint", '~> 3.0', require: false
@@ -33,12 +34,17 @@ group :development do
3334
gem "rubocop", '= 1.48.1', require: false
3435
gem "rubocop-performance", '= 1.16.0', require: false
3536
gem "rubocop-rspec", '= 2.19.0', require: false
37+
gem "puppet-strings", '~> 4.0', require: false
3638
gem "rb-readline", '= 0.5.5', require: false, platforms: [:mswin, :mingw, :x64_mingw]
3739
end
3840
group :system_tests do
3941
gem "puppet_litmus", '~> 1.0', require: false, platforms: [:ruby, :x64_mingw]
4042
gem "serverspec", '~> 2.41', require: false
4143
end
44+
group :release_prep do
45+
gem "puppet-strings", '~> 4.0', require: false
46+
gem "puppetlabs_spec_helper", '~> 7.0', require: false
47+
end
4248

4349
puppet_version = ENV['PUPPET_GEM_VERSION']
4450
facter_version = ENV['FACTER_GEM_VERSION']

Rakefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# frozen_string_literal: true
22

33
require 'bundler'
4-
require 'puppet_litmus/rake_tasks' if Bundler.rubygems.find_name('puppet_litmus').any?
4+
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 Bundler.rubygems.find_name('github_changelog_generator').any?
8-
require 'puppet-strings/tasks' if Bundler.rubygems.find_name('puppet-strings').any?
7+
require 'github_changelog_generator/task' if Gem.loaded_specs.key? 'github_changelog_generator'
8+
require 'puppet-strings/tasks' if Gem.loaded_specs.key? 'puppet-strings'
99

1010
def changelog_user
1111
return unless Rake.application.top_level_tasks.include? "changelog"
@@ -44,7 +44,7 @@ PuppetLint.configuration.send('disable_relative')
4444
PuppetLint.configuration.send('disable_anchor_resource')
4545

4646

47-
if Bundler.rubygems.find_name('github_changelog_generator').any?
47+
if Gem.loaded_specs.key? 'github_changelog_generator'
4848
GitHubChangelogGenerator::RakeTask.new :changelog do |config|
4949
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?
5050
config.user = "#{changelog_user}"

lib/puppet/provider/apt_key/apt_key.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@
88
end
99
require 'tempfile'
1010

11-
Puppet::Type.type(:apt_key).provide(:apt_key) do # rubocop:disable Metrics/BlockLength
11+
Puppet::Type.type(:apt_key).provide(:apt_key) do
1212
desc 'apt-key provider for apt_key resource'
1313

1414
confine osfamily: :debian
1515
defaultfor osfamily: :debian
1616
commands apt_key: 'apt-key'
1717
commands gpg: '/usr/bin/gpg'
1818

19-
def self.instances # rubocop:disable Metrics/AbcSize
19+
def self.instances
2020
key_array = []
2121

2222
cli_args = ['adv', '--no-tty', '--list-keys', '--with-colons', '--fingerprint', '--fixed-list-mode']

metadata.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,6 @@
3737
}
3838
],
3939
"template-url": "https://github.com/puppetlabs/pdk-templates.git#main",
40-
"template-ref": "heads/main-0-g9675180",
41-
"pdk-version": "2.7.1"
40+
"template-ref": "heads/main-0-g6916572",
41+
"pdk-version": "3.0.0"
4242
}

spec/default_facts.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Facts specified here will override the values provided by rspec-puppet-facts.
44
---
55
networking:
6-
ip: "172.16.254.254"
7-
ip6: "FE80:0000:0000:0000:AAAA:AAAA:AAAA"
8-
mac: "AA:AA:AA:AA:AA:AA"
6+
ip: "172.16.254.254"
7+
ip6: "FE80:0000:0000:0000:AAAA:AAAA:AAAA"
8+
mac: "AA:AA:AA:AA:AA:AA"
99
is_pe: false

spec/unit/puppet/provider/apt_key_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
).and_return(command_output)
4646
end
4747

48-
it 'returns 2 resources' do # rubocop:disable RSpec/MultipleExpectations
48+
it 'returns 2 resources' do
4949
expect(described_class.instances.size).to eq(2)
5050
expect(described_class.instances[0].name).to eq('630239CC130E1A7FD81A27B140976EAF437D05B5')
5151
expect(described_class.instances[0].id).to eq('40976EAF437D05B5')
@@ -116,7 +116,7 @@
116116
expect(provider).to be_exist
117117
end
118118

119-
it 'apt_key with content set' do # rubocop:disable RSpec/MultipleExpectations
119+
it 'apt_key with content set' do
120120
expect(described_class).to receive(:apt_key).with(array_including('add', kind_of(String)))
121121
resource = Puppet::Type::Apt_key.new(name: 'gsd',
122122
id: 'C105B9DE',
@@ -130,7 +130,7 @@
130130
expect(provider).to be_exist
131131
end
132132

133-
it 'apt_key with source set' do # rubocop:disable RSpec/MultipleExpectations
133+
it 'apt_key with source set' do
134134
expect(described_class).to receive(:apt_key).with(array_including('add', kind_of(String)))
135135
resource = Puppet::Type::Apt_key.new(name: 'gsd',
136136
id: 'C105B9DE',
@@ -144,7 +144,7 @@
144144
expect(provider).to be_exist
145145
end
146146

147-
it 'apt_key with source and weak ssl verify set' do # rubocop:disable RSpec/MultipleExpectations
147+
it 'apt_key with source and weak ssl verify set' do
148148
expect(described_class).to receive(:apt_key).with(array_including('add', kind_of(String)))
149149
resource = Puppet::Type::Apt_key.new(name: 'gsd',
150150
id: 'C105B9DE',

0 commit comments

Comments
 (0)