From d793d4d97e550932b56917cfe478911d18e9752c Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Fri, 8 Mar 2024 13:53:24 +0100 Subject: [PATCH 1/2] Drop Puppet 5.4 check We only support Puppet 7 and newer. We don't need to check if we're on Puppet 5.4 or newer. --- lib/puppet-syntax/manifests.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/puppet-syntax/manifests.rb b/lib/puppet-syntax/manifests.rb index 1b22cce..fcf1182 100644 --- a/lib/puppet-syntax/manifests.rb +++ b/lib/puppet-syntax/manifests.rb @@ -61,7 +61,7 @@ def check(filelist) private def validate_manifest(file) - Puppet[:tasks] = true if Puppet::Util::Package.versioncmp(Puppet.version, '5.4.0') >= 0 and file.match(%r{.*plans/.*\.pp$}) + Puppet[:tasks] = true if file.match(%r{.*plans/.*\.pp$}) Puppet::Face[:parser, :current].validate(file) end end From 258ba5f17672d52a130b9a68ba88c1e1f73e1241 Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Fri, 8 Mar 2024 13:59:39 +0100 Subject: [PATCH 2/2] rubocop: autocorrect --- .rubocop_todo.yml | 10 +++++----- lib/puppet-syntax/manifests.rb | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index ac8d92a..51a8dd6 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,6 +1,6 @@ # This configuration was generated by # `rubocop --auto-gen-config` -# on 2024-02-07 19:46:27 UTC using RuboCop version 1.60.2. +# on 2024-03-08 12:59:05 UTC using RuboCop version 1.61.0. # 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 @@ -31,6 +31,7 @@ Lint/SuppressedException: # Offense count: 1 # This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: AutoCorrect. Lint/UselessAssignment: Exclude: - 'lib/puppet-syntax/templates.rb' @@ -73,7 +74,7 @@ RSpec/DescribeClass: # Offense count: 19 # This cop supports unsafe autocorrection (--autocorrect-all). -# Configuration parameters: SkipBlocks, EnforcedStyle. +# Configuration parameters: SkipBlocks, EnforcedStyle, OnlyStaticConstants. # SupportedStyles: described_class, explicit RSpec/DescribedClass: Exclude: @@ -139,13 +140,12 @@ Rake/Desc: Exclude: - 'Rakefile' -# Offense count: 2 +# Offense count: 1 # This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: EnforcedStyle. # SupportedStyles: always, conditionals Style/AndOr: Exclude: - - 'lib/puppet-syntax/manifests.rb' - 'lib/puppet-syntax/templates.rb' # Offense count: 1 @@ -244,7 +244,7 @@ Style/SymbolProc: - 'lib/puppet-syntax/manifests.rb' - 'lib/puppet-syntax/templates.rb' -# Offense count: 3 +# Offense count: 2 # This cop supports safe autocorrection (--autocorrect). # Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns. # URISchemes: http, https diff --git a/lib/puppet-syntax/manifests.rb b/lib/puppet-syntax/manifests.rb index fcf1182..d277b8c 100644 --- a/lib/puppet-syntax/manifests.rb +++ b/lib/puppet-syntax/manifests.rb @@ -61,7 +61,7 @@ def check(filelist) private def validate_manifest(file) - Puppet[:tasks] = true if file.match(%r{.*plans/.*\.pp$}) + Puppet[:tasks] = true if %r{.*plans/.*\.pp$}.match?(file) Puppet::Face[:parser, :current].validate(file) end end