From 74c06ce28cba1412ad85c45c2d272491ea0b4c0f Mon Sep 17 00:00:00 2001 From: Lukas Audzevicius Date: Mon, 7 Apr 2025 16:02:05 +0100 Subject: [PATCH 1/3] (CAT-2281) Remove puppet 7 infrastructure Puppet 7 is EOL. Therefore, we can remove the test infrastructure for it. This commit aims to clear up any testing/config infrastructure related to Puppet 7 and, by extension, Ruby 2.7. --- .github/workflows/ci.yml | 2 -- .github/workflows/nightly.yml | 2 -- puppet-lint.gemspec | 2 +- rubocop_baseline.yml | 2 +- 4 files changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bd7aba13..ccf7a725 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,6 @@ jobs: fail-fast: false matrix: ruby_version: - - '2.7' - '3.2' - '3.3' name: "spec (ruby ${{ matrix.ruby_version }})" @@ -34,7 +33,6 @@ jobs: fail-fast: false matrix: ruby_version: - - '2.7' - '3.2' - '3.3' name: "acceptance (ruby ${{ matrix.ruby_version }})" diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 4c090b04..fabd7cbf 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -12,7 +12,6 @@ jobs: fail-fast: false matrix: ruby_version: - - '2.7' - '3.2' - '3.3' name: "spec (ruby ${{ matrix.ruby_version }})" @@ -26,7 +25,6 @@ jobs: fail-fast: false matrix: ruby_version: - - '2.7' - '3.2' - '3.3' name: "acceptance (ruby ${{ matrix.ruby_version }})" diff --git a/puppet-lint.gemspec b/puppet-lint.gemspec index 64ba7d85..43ffc003 100644 --- a/puppet-lint.gemspec +++ b/puppet-lint.gemspec @@ -32,5 +32,5 @@ Gem::Specification.new do |spec| ] spec.license = 'MIT' - spec.required_ruby_version = Gem::Requirement.new('>= 2.7'.freeze) + spec.required_ruby_version = Gem::Requirement.new('>= 3.1'.freeze) end diff --git a/rubocop_baseline.yml b/rubocop_baseline.yml index 4cf2aa0f..6ebcd745 100644 --- a/rubocop_baseline.yml +++ b/rubocop_baseline.yml @@ -6,7 +6,7 @@ AllCops: NewCops: enable ExtraDetails: true DisplayStyleGuide: true - TargetRubyVersion: '2.7' + TargetRubyVersion: '3.1' DisplayCopNames: true SuggestExtensions: false Exclude: From c22d5b91e8cd434691e193ca34fd28a9ecd3e9b2 Mon Sep 17 00:00:00 2001 From: Lukas Audzevicius Date: Wed, 9 Apr 2025 10:24:05 +0100 Subject: [PATCH 2/3] Safe rubocop autocorrections --- lib/puppet-lint.rb | 4 ++-- lib/puppet-lint/checkplugin.rb | 6 +++--- lib/puppet-lint/checks.rb | 2 +- lib/puppet-lint/configuration.rb | 2 +- lib/puppet-lint/data.rb | 2 +- lib/puppet-lint/lexer.rb | 4 ++-- lib/puppet-lint/lexer/string_slurper.rb | 12 ++++++------ lib/puppet-lint/monkeypatches.rb | 4 ++-- .../check_classes/arrow_on_right_operand_line.rb | 2 +- .../plugins/check_comments/slash_comments.rb | 2 +- .../plugins/check_comments/star_comments.rb | 2 +- .../plugins/check_nodes/unquoted_node_name.rb | 2 +- .../plugins/check_resources/ensure_first_param.rb | 2 +- .../check_resources/ensure_not_symlink_target.rb | 2 +- lib/puppet-lint/plugins/check_resources/file_mode.rb | 2 +- .../check_resources/unquoted_resource_title.rb | 2 +- .../plugins/check_strings/double_quoted_strings.rb | 4 ++-- .../plugins/check_strings/only_variable_string.rb | 4 ++-- .../check_strings/puppet_url_without_modules.rb | 2 +- .../plugins/check_strings/quoted_booleans.rb | 2 +- .../plugins/check_strings/variables_not_enclosed.rb | 2 +- .../plugins/check_whitespace/hard_tabs.rb | 2 +- .../plugins/check_whitespace/space_before_arrow.rb | 4 ++-- .../plugins/check_whitespace/trailing_whitespace.rb | 2 +- lib/puppet-lint/plugins/legacy_facts/legacy_facts.rb | 4 ++-- .../plugins/top_scope_facts/top_scope_facts.rb | 2 +- lib/puppet-lint/report/codeclimate.rb | 2 +- lib/puppet-lint/tasks/puppet-lint.rb | 4 ++-- lib/puppet-lint/tasks/release_test.rb | 4 ++-- spec/spec_helper.rb | 4 ++-- 30 files changed, 47 insertions(+), 47 deletions(-) diff --git a/lib/puppet-lint.rb b/lib/puppet-lint.rb index 06af3af3..c89d2a61 100644 --- a/lib/puppet-lint.rb +++ b/lib/puppet-lint.rb @@ -250,11 +250,11 @@ def print_problems # def check # end # end - def self.new_check(name, &block) + def self.new_check(name, &) class_name = name.to_s.split('_').map(&:capitalize).join klass = PuppetLint.const_set(:"Check#{class_name}", Class.new(PuppetLint::CheckPlugin)) klass.const_set(:NAME, name) - klass.class_exec(&block) + klass.class_exec(&) PuppetLint.configuration.add_check(name, klass) PuppetLint::Data.ignore_overrides[name] ||= {} end diff --git a/lib/puppet-lint/checkplugin.rb b/lib/puppet-lint/checkplugin.rb index 9561483a..3ca0fe36 100644 --- a/lib/puppet-lint/checkplugin.rb +++ b/lib/puppet-lint/checkplugin.rb @@ -180,9 +180,9 @@ def manifest_lines def default_info @default_info ||= { check: self.class.const_get(:NAME), - fullpath: fullpath, - path: path, - filename: filename + fullpath:, + path:, + filename: } end diff --git a/lib/puppet-lint/checks.rb b/lib/puppet-lint/checks.rb index f4c1fcff..1908432a 100644 --- a/lib/puppet-lint/checks.rb +++ b/lib/puppet-lint/checks.rb @@ -36,7 +36,7 @@ def load_data(path, content) problems << { kind: :error, check: :syntax, - message: message, + message:, line: e.line_no, column: e.column, fullpath: PuppetLint::Data.fullpath, diff --git a/lib/puppet-lint/configuration.rb b/lib/puppet-lint/configuration.rb index df6e60e2..6e35d228 100644 --- a/lib/puppet-lint/configuration.rb +++ b/lib/puppet-lint/configuration.rb @@ -48,7 +48,7 @@ def self.add_check(check) # Signature # #