From 49c59bf79c1e936513648503ace7558c2677567f Mon Sep 17 00:00:00 2001 From: Maqsood Ahmad Date: Fri, 13 Nov 2026 10:47:58 +0530 Subject: [PATCH 1/3] (MODULES-12012) Update .sync.yml for pdk-templates main Prepare .sync.yml for pdk update to pdk-templates main (8ca954f): set the hand edits to pdk-managed files that are still needed, so the template renders them, and drop settings main makes obsolete (the PR body lists each one kept or dropped). Co-Authored-By: Claude --- .sync.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.sync.yml b/.sync.yml index 06e8fa8..e90c94e 100644 --- a/.sync.yml +++ b/.sync.yml @@ -15,8 +15,6 @@ Gemfile: # needed for Puppet 9), and puppet_litmus below 2.8.0 doesn't support # --collection-platform-exclude, which ci.yml/nightly.yml pass unconditionally. overrides: - - gem: 'puppetlabs_spec_helper' - version: '~> 9.0' - gem: 'puppet_litmus' version: '~> 2.8' spec/spec_helper.rb: @@ -66,3 +64,7 @@ spec/spec_helper.rb: delete: true .rubocop.yml: include_todos: true +Rakefile: + # puppet-lint checks the module disabled by hand (Rakefile/.puppet-lint.rc) (MODULES-11997 pdk update) + extra_disabled_lint_checks: + - anchor_resource From 10c19c2cfdc233adec38ecc799169ebab44f038b Mon Sep 17 00:00:00 2001 From: Maqsood Ahmad Date: Fri, 13 Nov 2026 10:48:08 +0530 Subject: [PATCH 2/3] (MODULES-12012) Fix rubocop offenses under the template rubocop profile Safe autocorrect (rubocop --autocorrect) of the offenses the pdk-templates main (8ca954f) rubocop profile adds, so the pdk update commit does not park them in .rubocop_todo.yml. Safe cops only: no behaviour change. Also drop the two `rubocop:disable/enable RSpec/MultipleExpectations` pairs in keytool_spec.rb. The template profile already excludes provider specs from that cop, and a `rubocop:enable` comment opts the file back in, which made the whole file fail under the template's Max: 1. Comments only. Co-Authored-By: Claude --- lib/puppet/provider/java_ks/keytool.rb | 34 +++++++++---------- spec/acceptance/pkcs12_spec.rb | 2 +- .../puppet/provider/java_ks/keytool_spec.rb | 10 ++---- spec/unit/puppet/type/java_ks_spec.rb | 2 +- 4 files changed, 22 insertions(+), 26 deletions(-) diff --git a/lib/puppet/provider/java_ks/keytool.rb b/lib/puppet/provider/java_ks/keytool.rb index 59832a0..23e3863 100644 --- a/lib/puppet/provider/java_ks/keytool.rb +++ b/lib/puppet/provider/java_ks/keytool.rb @@ -162,7 +162,7 @@ def exists? tmpfile.close! true rescue StandardError => e - if e.message.match?(%r{password was incorrect}i) && (@resource[:password_fail_reset]) + if e.message.match?(%r{password was incorrect}i) && @resource[:password_fail_reset] # we have the wrong password for the keystore. so delete it if :password_fail_reset File.delete(@resource[:target]) end @@ -285,14 +285,14 @@ def certificate # certificate content and create a tempfile containing this value. # we leave it to to the tempfile to clean it up after the pupet run exists. @temp_certificate_file ||= begin - file = Tempfile.new('certificate') - # Check if the specified value is a Sensitive data type. If so, unwrap it and use - # the value. - content = @resource[:certificate_content].respond_to?(:unwrap) ? @resource[:certificate_content].unwrap : @resource[:certificate_content] - file.write(content) - file.close - file - end + file = Tempfile.new('certificate') + # Check if the specified value is a Sensitive data type. If so, unwrap it and use + # the value. + content = @resource[:certificate_content].respond_to?(:unwrap) ? @resource[:certificate_content].unwrap : @resource[:certificate_content] + file.write(content) + file.close + file + end @temp_certificate_file.path end @@ -305,14 +305,14 @@ def private_key # private key content and create a tempfile containing this value. # we leave it to to the tempfile to clean it up after the pupet run exists. @temp_private_key_file ||= begin - file = Tempfile.new('private_key') - # Check if the specified value is a Sensitive data type. If so, unwrap it and use - # the value. - content = @resource[:private_key_content].respond_to?(:unwrap) ? @resource[:private_key_content].unwrap : @resource[:private_key_content] - file.write(content) - file.close - file - end + file = Tempfile.new('private_key') + # Check if the specified value is a Sensitive data type. If so, unwrap it and use + # the value. + content = @resource[:private_key_content].respond_to?(:unwrap) ? @resource[:private_key_content].unwrap : @resource[:private_key_content] + file.write(content) + file.close + file + end @temp_private_key_file.path end diff --git a/spec/acceptance/pkcs12_spec.rb b/spec/acceptance/pkcs12_spec.rb index 18965e2..7231462 100644 --- a/spec/acceptance/pkcs12_spec.rb +++ b/spec/acceptance/pkcs12_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper_acceptance' # SLES by default does not support this form of encyrption. -describe 'managing java pkcs12', unless: (os[:family] == 'sles' || (os[:family] == 'debian' && os[:release].start_with?('10')) || (os[:family] == 'ubuntu' && os[:release].start_with?('18'))) do +describe 'managing java pkcs12', unless: os[:family] == 'sles' || (os[:family] == 'debian' && os[:release].start_with?('10')) || (os[:family] == 'ubuntu' && os[:release].start_with?('18')) do # rubocop:disable RSpec/InstanceVariable : Instance variables are inherited and thus cannot be contained within lets include_context 'with common variables' context 'with defaults' do diff --git a/spec/unit/puppet/provider/java_ks/keytool_spec.rb b/spec/unit/puppet/provider/java_ks/keytool_spec.rb index 47ba664..9318003 100755 --- a/spec/unit/puppet/provider/java_ks/keytool_spec.rb +++ b/spec/unit/puppet/provider/java_ks/keytool_spec.rb @@ -20,7 +20,7 @@ certificate: "#{temp_dir}app.example.com.pem", private_key: "#{temp_dir}private/app.example.com.pem", storetype: 'jceks', - provider: described_class.name + provider: described_class.name, } end let(:params) do @@ -122,7 +122,6 @@ testing_ca.sign(testing_key, OpenSSL::Digest.new('SHA256')) context 'when using the file based parameters for certificate and private_key' do - # rubocop:disable RSpec/MultipleExpectations # rubocop:disable RSpec/StubbedMock it 'converts a certificate to a pkcs12 file' do allow(provider).to receive(:password).and_return(resource[:password]) @@ -136,7 +135,6 @@ expect(OpenSSL::PKCS12).to receive(:create).with(resource[:password], resource[:name], 'priv_obj', 'cert_obj', []).and_return(pkcs_double) provider.to_pkcs12("#{temp_dir}testing.stuff") end - # rubocop:enable RSpec/MultipleExpectations # rubocop:enable RSpec/StubbedMock end @@ -148,7 +146,6 @@ ) end - # rubocop:disable RSpec/MultipleExpectations # rubocop:disable RSpec/StubbedMock it 'converts a certificate to a pkcs12 file' do allow(provider).to receive(:password).and_return(resource[:password]) @@ -162,7 +159,6 @@ expect(OpenSSL::PKCS12).to receive(:create).with(resource[:password], resource[:name], 'priv_obj', 'cert_obj', []).and_return(pkcs_double) provider.to_pkcs12("#{temp_dir}testing.stuff") end - # rubocop:enable RSpec/MultipleExpectations # rubocop:enable RSpec/StubbedMock end end @@ -198,7 +194,7 @@ certificate: "#{temp_dir}testing.p12", storetype: 'pkcs12', source_password: 'password', - provider: described_class.name + provider: described_class.name, } end @@ -230,7 +226,7 @@ password: 'puppet', certificate: "#{temp_dir}app.example.com.pem", private_key: "#{temp_dir}private/app.example.com.pem", - provider: described_class.name + provider: described_class.name, } end diff --git a/spec/unit/puppet/type/java_ks_spec.rb b/spec/unit/puppet/type/java_ks_spec.rb index 65a7207..f84544b 100644 --- a/spec/unit/puppet/type/java_ks_spec.rb +++ b/spec/unit/puppet/type/java_ks_spec.rb @@ -22,7 +22,7 @@ private_key: "#{temp_dir}private/app.example.com.pem", private_key_type: 'rsa', storetype: 'jceks', - provider: :keytool + provider: :keytool, } end let(:jks_resource) do From 135b79d792fa642e1b53013095377668018c8427 Mon Sep 17 00:00:00 2001 From: Maqsood Ahmad Date: Fri, 13 Nov 2026 10:48:19 +0530 Subject: [PATCH 3/3] (MODULES-12012) pdk update to pdk-templates main (8ca954f) Run pdk update (PDK 4.0.1) against pdk-templates main at 8ca954f. Pure pdk output, plus .rubocop_todo.yml regenerated with `rubocop --auto-gen-config --no-exclude-limit` (kept as is when only its header would change). Co-Authored-By: Claude --- .pdkignore | 2 +- .rubocop.yml | 722 +++++--------------------------------------- .rubocop_todo.yml | 127 +++++++- Gemfile | 121 +++++--- Rakefile | 5 +- metadata.json | 4 +- spec/spec_helper.rb | 2 +- 7 files changed, 281 insertions(+), 702 deletions(-) diff --git a/.pdkignore b/.pdkignore index 84684be..e758847 100644 --- a/.pdkignore +++ b/.pdkignore @@ -43,7 +43,7 @@ bolt-debug.log /Rakefile /rakelib/ /.rspec -/..yml +/.rubocop.yml /.yardopts /spec/ /.vscode/ diff --git a/.rubocop.yml b/.rubocop.yml index 47b1aad..8b7b844 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,7 +1,11 @@ --- -require: +plugins: - rubocop-performance +- rubocop-hash_inspect - rubocop-rspec +- rubocop-rspec_rails +- rubocop-factory_bot +- rubocop-capybara AllCops: NewCops: enable DisplayCopNames: true @@ -20,9 +24,15 @@ AllCops: - "**/Vagrantfile" - "**/Guardfile" inherit_from: ".rubocop_todo.yml" +inherit_mode: + merge: + - Exclude Layout/LineLength: Description: People have wide screens, use them. Max: 200 +Layout/EndOfLine: + Description: We enforce lf to ensure consistency across platforms. + EnforcedStyle: lf RSpec/BeforeAfterAll: Description: Beware of using after(:all) as it may cause state to leak between tests. A necessary evil in acceptance testing. @@ -73,659 +83,73 @@ Style/TrailingCommaInArrayLiteral: Style/SymbolArray: Description: Using percent style obscures symbolic intent of array's contents. EnforcedStyle: brackets -RSpec/MessageSpies: - EnforcedStyle: receive -Style/Documentation: - Exclude: - - lib/puppet/parser/functions/**/* - - spec/**/* Style/WordArray: + Description: Using percent style obscures symbolic intent of array's contents. EnforcedStyle: brackets -Performance/AncestorsInclude: - Enabled: true -Performance/BigDecimalWithNumericArgument: - Enabled: true -Performance/BlockGivenWithExplicitBlock: - Enabled: true -Performance/CaseWhenSplat: - Enabled: true -Performance/ConstantRegexp: - Enabled: true -Performance/MethodObjectAsBlock: - Enabled: true -Performance/RedundantSortBlock: - Enabled: true -Performance/RedundantStringChars: - Enabled: true -Performance/ReverseFirst: - Enabled: true -Performance/SortReverse: - Enabled: true -Performance/Squeeze: - Enabled: true -Performance/StringInclude: - Enabled: true -Performance/Sum: - Enabled: true -Style/CollectionMethods: - Enabled: true -Style/MethodCalledOnDoEndBlock: - Enabled: true -Style/StringMethods: - Enabled: true -Bundler/GemFilename: - Enabled: false -Bundler/InsecureProtocolSource: - Enabled: false -Capybara/CurrentPathExpectation: - Enabled: false -Capybara/VisibilityMatcher: - Enabled: false -Gemspec/DuplicatedAssignment: - Enabled: false -Gemspec/OrderedDependencies: - Enabled: false -Gemspec/RequiredRubyVersion: - Enabled: false -Gemspec/RubyVersionGlobalsUsage: - Enabled: false -Layout/ArgumentAlignment: - Enabled: false -Layout/BeginEndAlignment: - Enabled: false -Layout/ClosingHeredocIndentation: - Enabled: false -Layout/EmptyComment: - Enabled: false -Layout/EmptyLineAfterGuardClause: - Enabled: false -Layout/EmptyLinesAroundArguments: - Enabled: false -Layout/EmptyLinesAroundAttributeAccessor: - Enabled: false -Layout/EndOfLine: - Enabled: false -Layout/FirstArgumentIndentation: - Enabled: false -Layout/HashAlignment: - Enabled: false -Layout/HeredocIndentation: - Enabled: false -Layout/LeadingEmptyLines: - Enabled: false -Layout/SpaceAroundMethodCallOperator: - Enabled: false -Layout/SpaceInsideArrayLiteralBrackets: - Enabled: false -Layout/SpaceInsideReferenceBrackets: - Enabled: false -Lint/BigDecimalNew: - Enabled: false -Lint/BooleanSymbol: - Enabled: false -Lint/ConstantDefinitionInBlock: - Enabled: false -Lint/DeprecatedOpenSSLConstant: - Enabled: false -Lint/DisjunctiveAssignmentInConstructor: - Enabled: false -Lint/DuplicateElsifCondition: - Enabled: false -Lint/DuplicateRequire: - Enabled: false -Lint/DuplicateRescueException: - Enabled: false -Lint/EmptyConditionalBody: - Enabled: false -Lint/EmptyFile: - Enabled: false -Lint/ErbNewArguments: - Enabled: false -Lint/FloatComparison: - Enabled: false -Lint/HashCompareByIdentity: - Enabled: false -Lint/IdentityComparison: - Enabled: false -Lint/InterpolationCheck: - Enabled: false -Lint/MissingCopEnableDirective: - Enabled: false -Lint/MixedRegexpCaptureTypes: - Enabled: false -Lint/NestedPercentLiteral: - Enabled: false -Lint/NonDeterministicRequireOrder: - Enabled: false -Lint/OrderedMagicComments: - Enabled: false -Lint/OutOfRangeRegexpRef: - Enabled: false -Lint/RaiseException: - Enabled: false -Lint/RedundantCopEnableDirective: - Enabled: false -Lint/RedundantRequireStatement: - Enabled: false -Lint/RedundantSafeNavigation: - Enabled: false -Lint/RedundantWithIndex: - Enabled: false -Lint/RedundantWithObject: - Enabled: false -Lint/RegexpAsCondition: - Enabled: false -Lint/ReturnInVoidContext: - Enabled: false -Lint/SafeNavigationConsistency: - Enabled: false -Lint/SafeNavigationWithEmpty: - Enabled: false -Lint/SelfAssignment: - Enabled: false -Lint/SendWithMixinArgument: - Enabled: false -Lint/ShadowedArgument: - Enabled: false -Lint/StructNewOverride: - Enabled: false -Lint/ToJSON: - Enabled: false -Lint/TopLevelReturnWithArgument: - Enabled: false -Lint/TrailingCommaInAttributeDeclaration: - Enabled: false -Lint/UnreachableLoop: - Enabled: false -Lint/UriEscapeUnescape: - Enabled: false -Lint/UriRegexp: - Enabled: false -Lint/UselessMethodDefinition: - Enabled: false -Lint/UselessTimes: - Enabled: false -Metrics/AbcSize: - Enabled: false -Metrics/BlockLength: - Enabled: false -Metrics/BlockNesting: - Enabled: false -Metrics/ClassLength: - Enabled: false -Metrics/CyclomaticComplexity: - Enabled: false -Metrics/MethodLength: - Enabled: false -Metrics/ModuleLength: - Enabled: false -Metrics/ParameterLists: - Enabled: false -Metrics/PerceivedComplexity: - Enabled: false -Migration/DepartmentName: - Enabled: false -Naming/AccessorMethodName: - Enabled: false -Naming/BlockParameterName: - Enabled: false -Naming/HeredocDelimiterCase: - Enabled: false -Naming/HeredocDelimiterNaming: - Enabled: false -Naming/MemoizedInstanceVariableName: - Enabled: false -Naming/MethodParameterName: - Enabled: false -Naming/RescuedExceptionsVariableName: - Enabled: false -Naming/VariableNumber: - Enabled: false -Performance/BindCall: - Enabled: false -Performance/DeletePrefix: - Enabled: false -Performance/DeleteSuffix: - Enabled: false -Performance/InefficientHashSearch: - Enabled: false -Performance/UnfreezeString: - Enabled: false -Performance/UriDefaultParser: - Enabled: false -RSpec/Be: - Enabled: false -RSpec/Capybara/FeatureMethods: - Enabled: false -RSpec/ContainExactly: - Enabled: false -RSpec/ContextMethod: - Enabled: false -RSpec/ContextWording: - Enabled: false +Style/TrailingCommaInHashLiteral: + Description: PDK generates multiline hashes with trailing commas. Align with Style/TrailingCommaInArguments + and Style/TrailingCommaInArrayLiteral (both comma) so hash literals follow the + same project style. + EnforcedStyleForMultiline: comma RSpec/DescribeClass: + Description: rspec-puppet describes its subject by string class/define name (no + Ruby constant exists to reference), so this cop is never satisfiable for puppet + specs. This is structurally inapplicable, not a style preference -- distinct from + D-08 which governs style cops. Enabled: false -RSpec/EmptyHook: - Enabled: false -RSpec/EmptyLineAfterExample: - Enabled: false -RSpec/EmptyLineAfterExampleGroup: - Enabled: false -RSpec/EmptyLineAfterHook: - Enabled: false +RSpec/MessageSpies: + Description: PDK-generated specs and the rspec-puppet convention use the mock-style + `expect(...).to receive(...)` idiom throughout, not RuboCop's default spy-style + `have_received`. Restores the setting the old `strict` profile applied globally + (no Exclude needed -- provider/transport specs already comply). + EnforcedStyle: receive RSpec/ExampleLength: - Enabled: false -RSpec/ExampleWithoutDescription: - Enabled: false -RSpec/ExpectChange: - Enabled: false -RSpec/ExpectInHook: - Enabled: false -RSpec/FactoryBot/AttributeDefinedStatically: - Enabled: false -RSpec/FactoryBot/CreateList: - Enabled: false -RSpec/FactoryBot/FactoryClassName: - Enabled: false -RSpec/HooksBeforeExamples: - Enabled: false -RSpec/ImplicitBlockExpectation: - Enabled: false -RSpec/ImplicitSubject: - Enabled: false -RSpec/LeakyConstantDeclaration: - Enabled: false -RSpec/LetBeforeExamples: - Enabled: false -RSpec/MatchArray: - Enabled: false -RSpec/MissingExampleGroupArgument: - Enabled: false + Description: The resource-API provider specs PDK generates contain multi-line examples + covering multiple CRUD operations. Scoped to PDK-generated provider and transport + spec paths only (D-08). + Exclude: + - spec/unit/puppet/provider/**/*_spec.rb + - spec/unit/puppet/transport/**/*_spec.rb RSpec/MultipleExpectations: - Enabled: false -RSpec/MultipleMemoizedHelpers: - Enabled: false -RSpec/MultipleSubjects: - Enabled: false -RSpec/NestedGroups: - Enabled: false -RSpec/PredicateMatcher: - Enabled: false -RSpec/ReceiveCounts: - Enabled: false -RSpec/ReceiveNever: - Enabled: false -RSpec/RepeatedExampleGroupBody: - Enabled: false -RSpec/RepeatedExampleGroupDescription: - Enabled: false -RSpec/RepeatedIncludeExample: - Enabled: false -RSpec/ReturnFromStub: - Enabled: false -RSpec/SharedExamples: - Enabled: false -RSpec/StubbedMock: - Enabled: false -RSpec/UnspecifiedException: - Enabled: false -RSpec/VariableDefinition: - Enabled: false -RSpec/VoidExpect: - Enabled: false -RSpec/Yield: - Enabled: false -Security/Open: - Enabled: false -Style/AccessModifierDeclarations: - Enabled: false -Style/AccessorGrouping: - Enabled: false -Style/BisectedAttrAccessor: - Enabled: false -Style/CaseLikeIf: - Enabled: false -Style/ClassEqualityComparison: - Enabled: false -Style/ColonMethodDefinition: - Enabled: false -Style/CombinableLoops: - Enabled: false -Style/CommentedKeyword: - Enabled: false -Style/Dir: - Enabled: false -Style/DoubleCopDisableDirective: - Enabled: false -Style/EmptyBlockParameter: - Enabled: false -Style/EmptyLambdaParameter: - Enabled: false -Style/Encoding: - Enabled: false -Style/EvalWithLocation: - Enabled: false -Style/ExpandPathArguments: - Enabled: false -Style/ExplicitBlockArgument: - Enabled: false -Style/ExponentialNotation: - Enabled: false -Style/FloatDivision: - Enabled: false -Style/FrozenStringLiteralComment: - Enabled: false -Style/GlobalStdStream: - Enabled: false -Style/HashAsLastArrayItem: - Enabled: false -Style/HashLikeCase: - Enabled: false -Style/HashTransformKeys: - Enabled: false -Style/HashTransformValues: - Enabled: false -Style/IfUnlessModifier: - Enabled: false -Style/KeywordParametersOrder: - Enabled: false -Style/MinMax: - Enabled: false + Description: The resource-API provider specs PDK generates use multiple expectations + per example to cover resource attribute checks. Scoped to PDK-generated provider + and transport spec paths only (D-08). + Exclude: + - spec/unit/puppet/provider/**/*_spec.rb + - spec/unit/puppet/transport/**/*_spec.rb +RSpec/VerifiedDoubleReference: + Description: The resource-API provider and transport specs PDK generates use string-referenced + instance doubles (the Puppet provider constant is not loaded in the spec context). + Scoped to PDK-generated provider and transport spec paths only (D-08). + Exclude: + - spec/unit/puppet/provider/**/*_spec.rb + - spec/unit/puppet/transport/**/*_spec.rb +RSpec/ContextWording: + Description: rspec-puppet-facts uses the `context "on + Prefixes: + - when + - with + - without + - 'on' Style/MixinUsage: - Enabled: false -Style/MultilineWhenThen: - Enabled: false -Style/NegatedUnless: - Enabled: false -Style/NumericPredicate: - Enabled: false -Style/OptionalBooleanParameter: - Enabled: false -Style/OrAssignment: - Enabled: false -Style/RandomWithOffset: - Enabled: false -Style/RedundantAssignment: - Enabled: false -Style/RedundantCondition: - Enabled: false -Style/RedundantConditional: - Enabled: false -Style/RedundantFetchBlock: - Enabled: false -Style/RedundantFileExtensionInRequire: - Enabled: false -Style/RedundantRegexpCharacterClass: - Enabled: false -Style/RedundantRegexpEscape: - Enabled: false -Style/RedundantSelfAssignment: - Enabled: false -Style/RedundantSort: - Enabled: false -Style/RescueStandardError: - Enabled: false -Style/SingleArgumentDig: - Enabled: false -Style/SlicingWithRange: - Enabled: false -Style/SoleNestedConditional: - Enabled: false -Style/StderrPuts: - Enabled: false -Style/StringConcatenation: - Enabled: false -Style/Strip: - Enabled: false -Style/SymbolProc: - Enabled: false -Style/TrailingBodyOnClass: - Enabled: false -Style/TrailingBodyOnMethodDefinition: - Enabled: false -Style/TrailingBodyOnModule: - Enabled: false -Style/TrailingCommaInHashLiteral: - Enabled: false -Style/TrailingMethodEndStatement: - Enabled: false -Style/UnpackFirst: - Enabled: false -Capybara/MatchStyle: - Enabled: false -Capybara/NegationMatcher: - Enabled: false -Capybara/SpecificActions: - Enabled: false -Capybara/SpecificFinders: - Enabled: false -Capybara/SpecificMatcher: - Enabled: false -Gemspec/DeprecatedAttributeAssignment: - Enabled: false -Gemspec/DevelopmentDependencies: - Enabled: false -Gemspec/RequireMFA: - Enabled: false -Layout/LineContinuationLeadingSpace: - Enabled: false -Layout/LineContinuationSpacing: - Enabled: false -Layout/LineEndStringConcatenationIndentation: - Enabled: false -Layout/SpaceBeforeBrackets: - Enabled: false -Lint/AmbiguousAssignment: - Enabled: false -Lint/AmbiguousOperatorPrecedence: - Enabled: false -Lint/AmbiguousRange: - Enabled: false -Lint/ConstantOverwrittenInRescue: - Enabled: false -Lint/DeprecatedConstants: - Enabled: false -Lint/DuplicateBranch: - Enabled: false -Lint/DuplicateMagicComment: - Enabled: false -Lint/DuplicateMatchPattern: - Enabled: false -Lint/DuplicateRegexpCharacterClassElement: - Enabled: false -Lint/EmptyBlock: - Enabled: false + Description: rspec-puppet-facts requires the top-level `include RspecPuppetFacts` + idiom in spec_helper, which cannot be cleanly restructured without breaking the + facts test harness. Scoped to spec_helper only (D-07). + Exclude: + - spec/spec_helper.rb Lint/EmptyClass: - Enabled: false -Lint/EmptyInPattern: - Enabled: false -Lint/IncompatibleIoSelectWithFiberScheduler: - Enabled: false -Lint/LambdaWithoutLiteralBlock: - Enabled: false -Lint/NoReturnInBeginEndBlocks: - Enabled: false -Lint/NonAtomicFileOperation: - Enabled: false -Lint/NumberedParameterAssignment: - Enabled: false -Lint/OrAssignmentToConstant: - Enabled: false -Lint/RedundantDirGlobSort: - Enabled: false -Lint/RefinementImportMethods: - Enabled: false -Lint/RequireRangeParentheses: - Enabled: false -Lint/RequireRelativeSelfPath: - Enabled: false -Lint/SymbolConversion: - Enabled: false -Lint/ToEnumArguments: - Enabled: false -Lint/TripleQuotes: - Enabled: false -Lint/UnexpectedBlockArity: - Enabled: false -Lint/UnmodifiedReduceAccumulator: - Enabled: false -Lint/UselessRescue: - Enabled: false -Lint/UselessRuby2Keywords: - Enabled: false -Metrics/CollectionLiteralLength: - Enabled: false -Naming/BlockForwarding: - Enabled: false -Performance/CollectionLiteralInLoop: - Enabled: false -Performance/ConcurrentMonotonicTime: - Enabled: false -Performance/MapCompact: - Enabled: false -Performance/RedundantEqualityComparisonBlock: - Enabled: false -Performance/RedundantSplitRegexpArgument: - Enabled: false -Performance/StringIdentifierArgument: - Enabled: false -RSpec/BeEq: - Enabled: false -RSpec/BeNil: - Enabled: false -RSpec/ChangeByZero: - Enabled: false -RSpec/ClassCheck: - Enabled: false -RSpec/DuplicatedMetadata: - Enabled: false -RSpec/ExcessiveDocstringSpacing: - Enabled: false -RSpec/FactoryBot/ConsistentParenthesesStyle: - Enabled: false -RSpec/FactoryBot/FactoryNameStyle: - Enabled: false -RSpec/FactoryBot/SyntaxMethods: - Enabled: false -RSpec/IdenticalEqualityAssertion: - Enabled: false -RSpec/NoExpectationExample: - Enabled: false -RSpec/PendingWithoutReason: - Enabled: false -RSpec/Rails/AvoidSetupHook: - Enabled: false -RSpec/Rails/HaveHttpStatus: - Enabled: false -RSpec/Rails/InferredSpecType: - Enabled: false -RSpec/Rails/MinitestAssertions: - Enabled: false -RSpec/Rails/TravelAround: - Enabled: false -RSpec/RedundantAround: - Enabled: false -RSpec/SkipBlockInsideExample: - Enabled: false -RSpec/SortMetadata: - Enabled: false -RSpec/SubjectDeclaration: - Enabled: false -RSpec/VerifiedDoubleReference: - Enabled: false -Security/CompoundHash: - Enabled: false -Security/IoMethods: - Enabled: false -Style/ArgumentsForwarding: - Enabled: false -Style/ArrayIntersect: - Enabled: false -Style/CollectionCompact: - Enabled: false -Style/ComparableClamp: - Enabled: false -Style/ConcatArrayLiterals: - Enabled: false -Style/DataInheritance: - Enabled: false -Style/DirEmpty: - Enabled: false -Style/DocumentDynamicEvalDefinition: - Enabled: false -Style/EmptyHeredoc: - Enabled: false -Style/EndlessMethod: - Enabled: false -Style/EnvHome: - Enabled: false -Style/FetchEnvVar: - Enabled: false -Style/FileEmpty: - Enabled: false -Style/FileRead: - Enabled: false -Style/FileWrite: - Enabled: false -Style/HashConversion: - Enabled: false -Style/HashExcept: - Enabled: false -Style/IfWithBooleanLiteralBranches: - Enabled: false -Style/InPatternThen: - Enabled: false -Style/MagicCommentFormat: - Enabled: false -Style/MapCompactWithConditionalBlock: - Enabled: false -Style/MapToHash: - Enabled: false -Style/MapToSet: - Enabled: false -Style/MinMaxComparison: - Enabled: false -Style/MultilineInPatternThen: - Enabled: false -Style/NegatedIfElseCondition: - Enabled: false -Style/NestedFileDirname: - Enabled: false -Style/NilLambda: - Enabled: false -Style/NumberedParameters: - Enabled: false -Style/NumberedParametersLimit: - Enabled: false -Style/ObjectThen: - Enabled: false -Style/OpenStructUse: - Enabled: false -Style/OperatorMethodCall: - Enabled: false -Style/QuotedSymbols: - Enabled: false -Style/RedundantArgument: - Enabled: false -Style/RedundantConstantBase: - Enabled: false -Style/RedundantDoubleSplatHashBraces: - Enabled: false -Style/RedundantEach: - Enabled: false -Style/RedundantHeredocDelimiterQuotes: - Enabled: false -Style/RedundantInitialize: - Enabled: false -Style/RedundantLineContinuation: - Enabled: false -Style/RedundantSelfAssignmentBranch: - Enabled: false -Style/RedundantStringEscape: - Enabled: false -Style/SelectByRegexp: - Enabled: false -Style/StringChars: - Enabled: false -Style/SwapValues: - Enabled: false + Description: The generated transport device file uses the idiomatic Ruby namespace + forward-declaration `class Puppet::Util::NetworkDevice; end`. An empty class is + the standard namespace-shim idiom here and is not non-idiomatic code. Scoped to + the network_device path only (D-08). + Exclude: + - lib/puppet/util/network_device/**/*.rb +Lint/BooleanSymbol: + Description: Puppet types and providers use the symbols :true and :false as parameter + and property values (e.g. newvalues(:true, :false)), and specs set and assert + them. Autocorrecting them to true/false breaks the types. Scoped to type, provider + and spec paths, matching puppet's own .rubocop.yml. + Exclude: + - lib/puppet/type/**/*.rb + - lib/puppet/provider/**/*.rb + - spec/**/*.rb diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 8341765..487bd91 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,17 +1,132 @@ # This configuration was generated by -# `rubocop --auto-gen-config` -# on 2023-12-21 07:47:02 UTC using RuboCop version 1.48.1. +# `rubocop --auto-gen-config --no-exclude-limit` +# on 2026-11-13 05:36:18 UTC using RuboCop version 1.73.2. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new # versions of RuboCop, may require this file to be generated again. +# Offense count: 9 +Lint/CopDirectiveSyntax: + Exclude: + - 'lib/puppet/provider/java_ks/keytool.rb' + - 'lib/puppet/type/java_ks.rb' + - 'spec/acceptance/chain_key_spec.rb' + - 'spec/acceptance/content_spec.rb' + - 'spec/acceptance/destkeypass_spec.rb' + - 'spec/acceptance/keystore_spec.rb' + - 'spec/acceptance/pkcs12_spec.rb' + - 'spec/acceptance/private_key_spec.rb' + - 'spec/acceptance/truststore_spec.rb' + +# Offense count: 8 +# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes, Max. +Metrics/AbcSize: + Exclude: + - 'lib/puppet/provider/java_ks/keytool.rb' + - 'spec/spec_helper_acceptance_local.rb' + # Offense count: 3 -# This cop supports safe autocorrection (--autocorrect). -Lint/RedundantCopDisableDirective: +# Configuration parameters: CountComments, Max, CountAsOne, AllowedMethods, AllowedPatterns, inherit_mode. +# AllowedMethods: refine +Metrics/BlockLength: Exclude: - - 'spec/unit/puppet/provider/java_ks/keytool_spec.rb' + - 'lib/puppet/provider/java_ks/keytool.rb' + - 'lib/puppet/type/java_ks.rb' + +# Offense count: 4 +# Configuration parameters: AllowedMethods, AllowedPatterns, Max. +Metrics/CyclomaticComplexity: + Exclude: + - 'lib/puppet/provider/java_ks/keytool.rb' + - 'lib/puppet/type/java_ks.rb' + - 'spec/spec_helper_acceptance_local.rb' + +# Offense count: 14 +# Configuration parameters: CountComments, Max, CountAsOne, AllowedMethods, AllowedPatterns. +Metrics/MethodLength: + Exclude: + - 'lib/puppet/provider/java_ks/keytool.rb' + - 'lib/puppet/type/java_ks.rb' + - 'spec/spec_helper_acceptance_local.rb' # Offense count: 3 +# Configuration parameters: AllowedMethods, AllowedPatterns, Max. +Metrics/PerceivedComplexity: + Exclude: + - 'lib/puppet/provider/java_ks/keytool.rb' + - 'spec/spec_helper_acceptance_local.rb' + +# Offense count: 1 +# Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames. +# AllowedNames: as, at, by, cc, db, id, if, in, io, ip, of, on, os, pp, to +Naming/MethodParameterName: + Exclude: + - 'lib/puppet/type/java_ks.rb' + +# Offense count: 30 +# Configuration parameters: Max, CountAsOne. +RSpec/ExampleLength: + Exclude: + - 'spec/acceptance/chain_key_spec.rb' + - 'spec/acceptance/content_spec.rb' + - 'spec/acceptance/destkeypass_spec.rb' + - 'spec/acceptance/keystore_spec.rb' + - 'spec/acceptance/pkcs12_spec.rb' + - 'spec/acceptance/private_key_spec.rb' + - 'spec/acceptance/truststore_spec.rb' + - 'spec/unit/puppet/type/java_ks_spec.rb' + +# Offense count: 8 +# Configuration parameters: Max. RSpec/MultipleExpectations: - Max: 4 + Exclude: + - 'spec/acceptance/chain_key_spec.rb' + - 'spec/acceptance/keystore_spec.rb' + - 'spec/acceptance/truststore_spec.rb' + +# Offense count: 2 +# Configuration parameters: Max, AllowedGroups. +RSpec/NestedGroups: + Exclude: + - 'spec/unit/puppet/provider/java_ks/keytool_spec.rb' + +# Offense count: 18 +# Configuration parameters: AllowedPatterns. +# AllowedPatterns: ^expect_, ^assert_ +RSpec/NoExpectationExample: + Exclude: + - 'spec/acceptance/chain_key_spec.rb' + - 'spec/acceptance/content_spec.rb' + - 'spec/acceptance/destkeypass_spec.rb' + - 'spec/acceptance/keystore_spec.rb' + - 'spec/acceptance/pkcs12_spec.rb' + - 'spec/acceptance/private_key_spec.rb' + - 'spec/acceptance/truststore_spec.rb' + - 'spec/unit/puppet/type/java_ks_spec.rb' + +# Offense count: 8 +# This cop supports unsafe autocorrection (--autocorrect-all). +RSpec/ReceiveMessages: + Exclude: + - 'spec/unit/puppet/provider/java_ks/keytool_spec.rb' + - 'spec/unit/puppet/type/java_ks_spec.rb' + +# Offense count: 2 +# This cop supports unsafe autocorrection (--autocorrect-all). +RSpec/VerifiedDoubleReference: + Exclude: + - 'spec/unit/puppet/type/java_ks_spec.rb' + +# Offense count: 1 +# This cop supports unsafe autocorrection (--autocorrect-all). +Style/MapIntoArray: + Exclude: + - 'lib/puppet/provider/java_ks/keytool.rb' + +# Offense count: 2 +# Configuration parameters: AllowedMethods. +# AllowedMethods: respond_to_missing? +Style/OptionalBooleanParameter: + Exclude: + - 'lib/puppet/provider/java_ks/keytool.rb' diff --git a/Gemfile b/Gemfile index ce90d28..42afc65 100644 --- a/Gemfile +++ b/Gemfile @@ -1,31 +1,70 @@ -# For puppetcore, set GEM_SOURCE_PUPPETCORE = 'https://rubygems-puppetcore.puppet.com' +# frozen_string_literal: true + +# Defaults to puppetcore regardless of PUPPET_FORGE_TOKEN/network state. +# Opt out: bundle config set gemsource.public true gemsource_default = ENV['GEM_SOURCE'] || 'https://rubygems.org' -gemsource_puppetcore = if ENV['PUPPET_FORGE_TOKEN'] - 'https://rubygems-puppetcore.puppet.com' +gemsource_public_opt_out = Bundler.settings['gemsource.public'] +gemsource_puppetcore = if gemsource_public_opt_out + gemsource_default else - ENV['GEM_SOURCE_PUPPETCORE'] || gemsource_default + 'https://rubygems-puppetcore.puppet.com' end source gemsource_default -def location_for(place_or_version, fake_version = nil, opts = {}) - git_url_regex = %r{\A(?(https?|git)[:@][^#]*)(#(?.*))?} - file_url_regex = %r{\Afile:\/\/(?.*)} +unless ENV['PUPPET_FORGE_TOKEN'] || ENV['BUNDLE_RUBYGEMS___PUPPETCORE__PUPPET__COM'] || + Bundler.settings['gemsource.airgapped'] || gemsource_public_opt_out + Bundler.ui.warn <<~WARNING + No puppetcore credentials detected. + On an airgapped install, run `bundle config set gemsource.airgapped true` to suppress this warning. + To use public gems instead, run `bundle config set gemsource.public true`. + WARNING +end + +def location_for(place_or_constraint, fake_constraint = nil, opts = {}) + git_url_regex = /\A(?(?:https?|git)[:@][^#]*)(?:#(?.*))?/ + file_url_regex = %r{\Afile://(?.*)} + + if place_or_constraint && (git_url = place_or_constraint.match(git_url_regex)) + # Git source → ignore :source, keep fake_constraint + [fake_constraint, { git: git_url[:url], branch: git_url[:branch], require: false }].compact + + elsif place_or_constraint && (file_url = place_or_constraint.match(file_url_regex)) + # File source → ignore :source, keep fake_constraint or default >= 0 + [fake_constraint || '>= 0', { path: File.expand_path(file_url[:path]), require: false }] - if place_or_version && (git_url = place_or_version.match(git_url_regex)) - [fake_version, { git: git_url[:url], branch: git_url[:branch], require: false }].compact - elsif place_or_version && (file_url = place_or_version.match(file_url_regex)) - ['>= 0', { path: File.expand_path(file_url[:path]), require: false }] else - [place_or_version, { require: false }.merge(opts)] + # Plain version constraint → merge opts (including :source if provided) + [place_or_constraint, { require: false }.merge(opts)] + end +end + +# Works around a bundler multi_json/puppet resolution bug - see pdk-templates/docs/adr/0001. +def puppet_floor_version(puppetcore_source) + return nil if puppetcore_source == 'https://rubygems.org' + + ruby_version = Gem::Version.new(RUBY_VERSION.dup) + return '~> 9.0' if Gem::Requirement.create('>= 3.4.0').satisfied_by?(ruby_version) + return '~> 8.17' if Gem::Requirement.create('>= 3.1.0').satisfied_by?(ruby_version) + + nil # puppet 8+ requires ruby >= 3.1; leave older rubies unconstrained +end + +# Print debug information if DEBUG_GEMS or VERBOSE is set +def print_gem_statement_for(gems) + puts 'DEBUG: Gem definitions that will be generated:' + gems.each do |gem_name, gem_params| + puts "DEBUG: gem #{([gem_name.inspect] + gem_params.map(&:inspect)).join(', ')}" end end group :development do 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)) 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)) + gem "json", '= 2.18.0', require: false if Gem::Requirement.create(['>= 4.0.0', '< 5.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) 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)) gem "deep_merge", '~> 1.2.2', require: false - gem "voxpupuli-puppet-lint-plugins", '~> 7.0', require: false + gem "voxpupuli-puppet-lint-plugins", '~> 7.0', require: false if gemsource_puppetcore != "https://rubygems.org" + gem "voxpupuli-puppet-lint-plugins", '~> 6.0', require: false if gemsource_puppetcore == "https://rubygems.org" gem "facterdb", '~> 2.1', require: false if Gem::Requirement.create(['< 3.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) gem "facterdb", '~> 3.0', require: false if Gem::Requirement.create(['>= 3.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) gem "metadata-json-lint", '~> 4.0', require: false @@ -37,47 +76,43 @@ group :development do gem "pry", '~> 0.10', require: false gem "simplecov-console", '~> 0.9', require: false gem "puppet-debugger", '~> 1.6', require: false - gem "rubocop", '~> 1.50.0', require: false - gem "rubocop-performance", '= 1.16.0', require: false - gem "rubocop-rspec", '= 2.19.0', require: false - gem "rb-readline", '= 0.5.5', require: false, platforms: [:mswin, :mingw, :x64_mingw] - gem "bigdecimal", '< 3.2.2', require: false, platforms: [:mswin, :mingw, :x64_mingw] + gem "rubocop", '~> 1.73.0', require: false + gem "rubocop-performance", '~> 1.24.0', require: false + gem "rubocop-hash_inspect", '~> 0.2', require: false + gem "rubocop-rspec", '~> 3.5.0', require: false + gem "rubocop-rspec_rails", '~> 2.31.0', require: false + gem "rubocop-factory_bot", '~> 2.27.0', require: false + gem "rubocop-capybara", '~> 2.22.0', require: false + gem "rb-readline", '= 0.5.5', require: false, platforms: [:windows] + gem "bigdecimal", '< 3.2.2', require: false, platforms: [:windows] gem "ruby-pwsh", require: false end group :development, :release_prep do - gem "puppet-strings", '~> 4.0', require: false - gem "puppetlabs_spec_helper", '~> 9.0', require: false - gem "puppet-blacksmith", '~> 7.0', require: false + gem "puppet-strings", '>= 4.0', '< 6.0', require: false + gem "puppetlabs_spec_helper", '~> 9.0', require: false if gemsource_puppetcore != "https://rubygems.org" + gem "puppetlabs_spec_helper", '~> 8.0', require: false if gemsource_puppetcore == "https://rubygems.org" + gem "puppet-blacksmith", '>= 7.0', '< 10.0', require: false end group :system_tests do - # 2.7.0 is the first release whose matrix_from_metadata_v3 knows about Puppet 9: it gates - # the collection on PUPPET_FORGE_TOKEN and emits the '~> 9.0' spec_matrix entry. Floored - # unconditionally at 2.8, since --collection-platform-exclude (which ci.yml/nightly.yml pass - # unconditionally) only exists from 2.8.0 onward -- older 2.x releases hard-fail with - # OptionParser::InvalidOption instead of degrading gracefully. pdk-templates' own - # Gemfile.erb only ever generates a single unconditional puppet_litmus line here; the - # PUPPET_FORGE_TOKEN-gated split this module used to carry was a hand-maintained - # deviation, not something the template emits. - gem "puppet_litmus", '~> 2.8', require: false, platforms: [:ruby, :x64_mingw] - gem "CFPropertyList", '< 3.0.7', require: false, platforms: [:mswin, :mingw, :x64_mingw] + gem "puppet_litmus", '~> 2.8', require: false + gem "faraday", '~> 2.5', require: false + gem "CFPropertyList", '< 3.0.7', require: false if RUBY_PLATFORM.include?('darwin') gem "serverspec", '~> 2.41', require: false end - gems = {} - -puppet_version = ENV.fetch('PUPPET_GEM_VERSION', nil) +bolt_version = ENV.fetch('BOLT_GEM_VERSION', nil) +puppet_version = ENV.fetch('PUPPET_GEM_VERSION', puppet_floor_version(gemsource_puppetcore)) facter_version = ENV.fetch('FACTER_GEM_VERSION', nil) hiera_version = ENV.fetch('HIERA_GEM_VERSION', nil) -# Puppet 9.0.0 is a released gem on the standard puppetcore source (confirmed: -# puppetlabs-windows_eventlog#100's CI resolves `puppet (9.0.0)` from -# gemsource_puppetcore with no PUPPET_GEM_SOURCE set) -- no separate internal/Twingate -# source or prerelease-specific version matching is needed for it anymore. +gems['bolt'] = location_for(bolt_version, nil, { source: gemsource_puppetcore }) gems['puppet'] = location_for(puppet_version, nil, { source: gemsource_puppetcore }) gems['facter'] = location_for(facter_version, nil, { source: gemsource_puppetcore }) gems['hiera'] = location_for(hiera_version, nil, {}) if hiera_version +# Generate the gem definitions +print_gem_statement_for(gems) if ENV['DEBUG'] gems.each do |gem_name, gem_params| gem gem_name, *gem_params end @@ -85,12 +120,14 @@ end # Evaluate Gemfile.local and ~/.gemfile if they exist extra_gemfiles = [ "#{__FILE__}.local", - File.join(Dir.home, '.gemfile'), + File.join(Dir.home, '.gemfile') ] extra_gemfiles.each do |gemfile| - if File.file?(gemfile) && File.readable?(gemfile) - eval(File.read(gemfile), binding) - end + next unless File.file?(gemfile) && File.readable?(gemfile) + + # rubocop:disable Security/Eval + eval(File.read(gemfile), binding) + # rubocop:enable Security/Eval end # vim: syntax=ruby diff --git a/Rakefile b/Rakefile index a10125e..d980721 100644 --- a/Rakefile +++ b/Rakefile @@ -3,7 +3,8 @@ require 'bundler' require 'puppet_litmus/rake_tasks' if Gem.loaded_specs.key? 'puppet_litmus' require 'puppetlabs_spec_helper/rake_tasks' -require 'puppetlabs-syntax/tasks/puppetlabs-syntax' +require 'puppet-syntax/tasks/puppet-syntax' if Gem.loaded_specs.key? 'puppet-syntax' +require 'puppetlabs-syntax/tasks/puppetlabs-syntax' if Gem.loaded_specs.key? 'puppetlabs-syntax' require 'puppet-strings/tasks' if Gem.loaded_specs.key? 'puppet-strings' PuppetLint.configuration.send('disable_relative') @@ -13,5 +14,7 @@ PuppetLint.configuration.send('disable_class_inherits_from_params_class') PuppetLint.configuration.send('disable_autoloader_layout') PuppetLint.configuration.send('disable_documentation') PuppetLint.configuration.send('disable_single_quote_string_with_variables') +PuppetLint.configuration.send('disable_anchor_resource') PuppetLint.configuration.fail_on_warnings = true PuppetLint.configuration.ignore_paths = [".vendor/**/*.pp", ".bundle/**/*.pp", "pkg/**/*.pp", "spec/**/*.pp", "tests/**/*.pp", "types/**/*.pp", "vendor/**/*.pp"] + diff --git a/metadata.json b/metadata.json index dfa8a84..a25fefc 100644 --- a/metadata.json +++ b/metadata.json @@ -104,7 +104,7 @@ } ], "description": "Uses a combination of keytool and Ruby openssl library to manage entries in a Java keystore.", - "pdk-version": "3.5.0 (ga43db72)", + "pdk-version": "4.0.1", "template-url": "https://github.com/puppetlabs/pdk-templates.git#main", - "template-ref": "heads/main-0-g11c0f3d" + "template-ref": "heads/main-0-g8ca954f" } diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index ae7c1f6..2f7fdae 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -26,7 +26,7 @@ begin require 'deep_merge' - default_facts.deep_merge!(YAML.safe_load(File.read(f), permitted_classes: [], permitted_symbols: [], aliases: true)) + default_facts.deep_merge!(YAML.safe_load_file(f, permitted_classes: [], permitted_symbols: [], aliases: true)) rescue StandardError => e RSpec.configuration.reporter.message "WARNING: Unable to load #{f}: #{e}" end