From 7050aabb7791c6071531cd4be6eb0e8c30bf3799 Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Tue, 15 Oct 2024 21:32:11 +0200 Subject: [PATCH] voxpupuli-rubocop: Switch to 2.8.0 --- .rubocop_todo.yml | 19 ++++++++++++++++++- lib/puppet_blacksmith/version_helper.rb | 4 ++-- puppet-blacksmith.gemspec | 2 +- spec/puppet_blacksmith/forge_live_spec.rb | 2 +- spec/puppet_blacksmith/git_spec.rb | 4 ++-- 5 files changed, 24 insertions(+), 7 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index def979b..fe49dfe 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,6 +1,6 @@ # This configuration was generated by # `rubocop --auto-gen-config` -# on 2023-05-08 20:48:34 UTC using RuboCop version 1.50.2. +# on 2024-10-21 08:47:36 UTC using RuboCop version 1.64.1. # 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 @@ -14,6 +14,7 @@ Lint/EmptyBlock: - 'spec/puppet_blacksmith/git_spec.rb' # Offense count: 1 +# Configuration parameters: AllowedParentClasses. Lint/MissingSuper: Exclude: - 'lib/puppet_blacksmith/rake_tasks.rb' @@ -26,7 +27,17 @@ Lint/RaiseException: Exclude: - 'lib/puppet_blacksmith/version_helper.rb' +# Offense count: 2 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: strict, consistent +Lint/SymbolConversion: + Exclude: + - 'lib/puppet_blacksmith/rake_tasks.rb' + # Offense count: 1 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: AutoCorrect. Lint/UselessAssignment: Exclude: - 'spec/puppet_blacksmith/forge_spec.rb' @@ -62,6 +73,12 @@ Performance/Detect: Exclude: - 'lib/puppet_blacksmith/forge.rb' +# Offense count: 2 +# This cop supports safe autocorrection (--autocorrect). +Performance/StringIdentifierArgument: + Exclude: + - 'lib/puppet_blacksmith/modulefile.rb' + # Offense count: 8 # Configuration parameters: Prefixes, AllowedPatterns. # Prefixes: when, with, without diff --git a/lib/puppet_blacksmith/version_helper.rb b/lib/puppet_blacksmith/version_helper.rb index 48a29cb..f8b5fc6 100644 --- a/lib/puppet_blacksmith/version_helper.rb +++ b/lib/puppet_blacksmith/version_helper.rb @@ -102,7 +102,7 @@ def satisfies(other_version) end %i[major minor patch].each do |term| - define_method("#{term}!") { increment!(term) } + define_method(:"#{term}!") { increment!(term) } end def full! @@ -118,7 +118,7 @@ def full! def increment!(term) new_version = clone - new_version.send("#{term}=", send(term) + 1) if term != :patch || @pre.nil? + new_version.send(:"#{term}=", send(term) + 1) if term != :patch || @pre.nil? new_version.minor = 0 if term == :major new_version.patch = 0 if %i[major minor].include?(term) diff --git a/puppet-blacksmith.gemspec b/puppet-blacksmith.gemspec index cb96a60..886b070 100644 --- a/puppet-blacksmith.gemspec +++ b/puppet-blacksmith.gemspec @@ -23,7 +23,7 @@ Gem::Specification.new do |s| s.add_development_dependency 'puppet', '>= 7.24', '< 9' s.add_development_dependency 'rake', '~> 13.0', '>= 13.0.6' s.add_development_dependency 'rspec', '~> 3.12' - s.add_development_dependency 'voxpupuli-rubocop', '~> 2.0' + s.add_development_dependency 'voxpupuli-rubocop', '~> 2.8.0' s.add_development_dependency 'webmock', '>= 2.0', '< 4' s.files = Dir.glob('lib/**/*') + %w[LICENSE] diff --git a/spec/puppet_blacksmith/forge_live_spec.rb b/spec/puppet_blacksmith/forge_live_spec.rb index 569115d..6a3bbfa 100644 --- a/spec/puppet_blacksmith/forge_live_spec.rb +++ b/spec/puppet_blacksmith/forge_live_spec.rb @@ -3,7 +3,7 @@ require 'fileutils' # Run tests against the real Forge staging API -describe 'Blacksmith::Forge', live: true do +describe 'Blacksmith::Forge', :live do include_context 'forge' let(:username) { nil } diff --git a/spec/puppet_blacksmith/git_spec.rb b/spec/puppet_blacksmith/git_spec.rb index 2d07239..fb843c0 100644 --- a/spec/puppet_blacksmith/git_spec.rb +++ b/spec/puppet_blacksmith/git_spec.rb @@ -98,8 +98,8 @@ context 'when git succeeds' do before do - allow(Open3).to receive(:popen3) \ - .with('git', '--git-dir', File.join(path, '.git'), '--work-tree', path, *cmd) \ + allow(Open3).to receive(:popen3) + .with('git', '--git-dir', File.join(path, '.git'), '--work-tree', path, *cmd) .and_yield(nil, double(read: stdout), double(read: stderr), wait_thr) expect { subject.send(:exec_git, cmd) }.not_to raise_error end