From 8b2204cae117d2bc6014aeb09bcbc04cccc4f905 Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Fri, 18 Aug 2023 08:40:55 +0200 Subject: [PATCH] rubocop: autofix --- .rubocop.yml | 1 + .rubocop_todo.yml | 23 +++++++++++++++++++ lib/puppet/provider/rvm_alias/alias.rb | 2 +- lib/puppet/provider/rvm_gem/gem.rb | 2 +- lib/puppet/provider/rvm_gemset/gemset.rb | 2 +- .../rvm_system_ruby/rvm_system_ruby.rb | 2 +- lib/puppet/provider/rvm_wrapper/wrapper.rb | 2 +- 7 files changed, 29 insertions(+), 5 deletions(-) create mode 100644 .rubocop_todo.yml diff --git a/.rubocop.yml b/.rubocop.yml index 53ac1898..fded90cf 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -2,5 +2,6 @@ # Managed by modulesync - DO NOT EDIT # https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ +inherit_from: .rubocop_todo.yml inherit_gem: voxpupuli-test: rubocop.yml diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml new file mode 100644 index 00000000..7a294a91 --- /dev/null +++ b/.rubocop_todo.yml @@ -0,0 +1,23 @@ +# This configuration was generated by +# `rubocop --auto-gen-config` +# on 2024-01-08 18:55:36 UTC using RuboCop version 1.50.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: 12 +# Configuration parameters: Max. +RSpec/IndexedLet: + Exclude: + - 'spec/acceptance/rvm_system_spec.rb' + +# Offense count: 5 +# This cop supports unsafe autocorrection (--autocorrect-all). +Style/EnvHome: + Exclude: + - 'lib/puppet/provider/rvm_alias/alias.rb' + - 'lib/puppet/provider/rvm_gem/gem.rb' + - 'lib/puppet/provider/rvm_gemset/gemset.rb' + - 'lib/puppet/provider/rvm_system_ruby/rvm_system_ruby.rb' + - 'lib/puppet/provider/rvm_wrapper/wrapper.rb' diff --git a/lib/puppet/provider/rvm_alias/alias.rb b/lib/puppet/provider/rvm_alias/alias.rb index 4990ceb5..6bff27b7 100644 --- a/lib/puppet/provider/rvm_alias/alias.rb +++ b/lib/puppet/provider/rvm_alias/alias.rb @@ -5,7 +5,7 @@ desc 'RVM alias support.' has_command(:rvmcmd, '/usr/local/rvm/bin/rvm') do - environment HOME: ENV['HOME'] + environment HOME: ENV.fetch('HOME', nil) end def target_ruby diff --git a/lib/puppet/provider/rvm_gem/gem.rb b/lib/puppet/provider/rvm_gem/gem.rb index 343a7376..027dcbcd 100644 --- a/lib/puppet/provider/rvm_gem/gem.rb +++ b/lib/puppet/provider/rvm_gem/gem.rb @@ -9,7 +9,7 @@ has_feature :versionable has_command(:rvmcmd, '/usr/local/rvm/bin/rvm') do - environment HOME: ENV['HOME'] + environment HOME: ENV.fetch('HOME', nil) end def ruby_version diff --git a/lib/puppet/provider/rvm_gemset/gemset.rb b/lib/puppet/provider/rvm_gemset/gemset.rb index 78fa3268..e54a668b 100644 --- a/lib/puppet/provider/rvm_gemset/gemset.rb +++ b/lib/puppet/provider/rvm_gemset/gemset.rb @@ -5,7 +5,7 @@ desc 'RVM gemset support.' has_command(:rvmcmd, '/usr/local/rvm/bin/rvm') do - environment HOME: ENV['HOME'] + environment HOME: ENV.fetch('HOME', nil) end def ruby_version diff --git a/lib/puppet/provider/rvm_system_ruby/rvm_system_ruby.rb b/lib/puppet/provider/rvm_system_ruby/rvm_system_ruby.rb index 7eaf96cf..f3545317 100644 --- a/lib/puppet/provider/rvm_system_ruby/rvm_system_ruby.rb +++ b/lib/puppet/provider/rvm_system_ruby/rvm_system_ruby.rb @@ -4,7 +4,7 @@ desc 'Ruby RVM support.' has_command(:rvmcmd, '/usr/local/rvm/bin/rvm') do - environment HOME: ENV['HOME'] + environment HOME: ENV.fetch('HOME', nil) end def create diff --git a/lib/puppet/provider/rvm_wrapper/wrapper.rb b/lib/puppet/provider/rvm_wrapper/wrapper.rb index c5e0d161..fd46c557 100644 --- a/lib/puppet/provider/rvm_wrapper/wrapper.rb +++ b/lib/puppet/provider/rvm_wrapper/wrapper.rb @@ -5,7 +5,7 @@ desc 'RVM wrapper support.' has_command(:rvmcmd, '/usr/local/rvm/bin/rvm') do - environment HOME: ENV['HOME'] + environment HOME: ENV.fetch('HOME', nil) end def target_ruby