Skip to content

Commit 146fe0b

Browse files
authored
Merge pull request #1149 from puppetlabs/CAT-1608-pdk-update
Cat 1608 pdk update
2 parents cb21d0b + c2b2376 commit 146fe0b

File tree

9 files changed

+27
-28
lines changed

9 files changed

+27
-28
lines changed

.rubocop.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
---
2-
inherit_from: .rubocop_todo.yml
3-
42
require:
53
- rubocop-performance
64
- rubocop-rspec
75
AllCops:
6+
NewCops: enable
87
DisplayCopNames: true
9-
TargetRubyVersion: '2.6'
8+
TargetRubyVersion: '2.7'
109
Include:
1110
- "**/*.rb"
1211
Exclude:
@@ -20,6 +19,7 @@ AllCops:
2019
- "**/Puppetfile"
2120
- "**/Vagrantfile"
2221
- "**/Guardfile"
22+
inherit_from: ".rubocop_todo.yml"
2323
Layout/LineLength:
2424
Description: People have wide screens, use them.
2525
Max: 200

.rubocop_todo.yml

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,12 @@
11
# This configuration was generated by
22
# `rubocop --auto-gen-config`
3-
# on 2023-06-08 10:35:18 UTC using RuboCop version 1.48.1.
3+
# on 2023-11-28 13:42:03 UTC using RuboCop version 1.48.1.
44
# The point is for the user to remove these configuration records
55
# one by one as the offenses are removed from the code base.
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'
15-
16-
# Offense count: 204
9+
# Offense count: 200
1710
# Configuration parameters: EnforcedStyle, IgnoreSharedExamples.
1811
# SupportedStyles: always, named_only
1912
RSpec/NamedSubject:

.sync.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
delete: true
44
appveyor.yml:
55
delete: true
6+
.rubocop.yml:
7+
include_todos: true
68

79
Gemfile:
810
Rakefile:

Gemfile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ 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
25-
gem "puppetlabs_spec_helper", '~> 7.0', require: false
2626
gem "rspec-puppet-facts", '~> 2.0', require: false
2727
gem "codecov", '~> 0.2', require: false
2828
gem "dependency_checker", '~> 1.0.0', require: false
@@ -39,6 +39,10 @@ group :system_tests do
3939
gem "puppet_litmus", '~> 1.0', require: false, platforms: [:ruby, :x64_mingw]
4040
gem "serverspec", '~> 2.41', require: false
4141
end
42+
group :release_prep do
43+
gem "puppet-strings", '~> 4.0', require: false
44+
gem "puppetlabs_spec_helper", '~> 7.0', require: false
45+
end
4246

4347
puppet_version = ENV['PUPPET_GEM_VERSION']
4448
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-g01c6a19",
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)