From 28fdde55a0358a6b3dcc137b526b118031f4769a Mon Sep 17 00:00:00 2001 From: Tino Vazquez Date: Thu, 5 Dec 2019 19:22:35 +0100 Subject: [PATCH] L #-: Adjustments for rubocop 0.77.0 (cherry picked from commit 5ead940b167e592319617b775e37a17fa43a4e78) --- share/linters/.rubocop.yml | 8 ++++---- src/cli/oneuser | 11 +++-------- src/hem/onehem-server.rb | 2 +- src/oneprovision/lib/resource.rb | 4 ++-- 4 files changed, 10 insertions(+), 15 deletions(-) diff --git a/share/linters/.rubocop.yml b/share/linters/.rubocop.yml index 49683e7f46..d6eb846f7d 100644 --- a/share/linters/.rubocop.yml +++ b/share/linters/.rubocop.yml @@ -607,7 +607,7 @@ Layout/EmptyLinesAroundModuleBody: Layout/EmptyLineAfterGuardClause: Enabled: true -Layout/AlignHash: +Layout/HashAlignment: Enabled: false Layout/SpaceAroundOperators: @@ -727,12 +727,12 @@ Lint/DuplicateCaseCondition: Lint/DuplicateMethods: Enabled: true -Lint/DuplicatedKey: +Lint/DuplicateHashKey: Enabled: true ## # check empty exceptions -Lint/HandleExceptions: +Lint/SuppressedException: Enabled: true # check matching parameters in format @@ -798,7 +798,7 @@ Naming/ConstantName: Naming/HeredocDelimiterNaming: Enabled: false -Naming/UncommunicativeMethodParamName: +Naming/MethodParameterName: Enabled: false ### diff --git a/src/cli/oneuser b/src/cli/oneuser index 0e19a9fe1c..a9134ef6d3 100755 --- a/src/cli/oneuser +++ b/src/cli/oneuser @@ -708,12 +708,7 @@ CommandParser::CmdParser.new(ARGV) do auth_string = "#{user['NAME']}:#{token}" auth_file = helper.auth_file(auth_string) - # rubocop:disable Lint/HandleExceptions - begin - FileUtils.mkdir_p(File.dirname(auth_file)) - rescue Errno::EEXIST - end - # rubocop:enable Lint/HandleExceptions + FileUtils.mkdir_p(File.dirname(auth_file)) rescue Errno::EEXIST file = File.open(auth_file, 'w') file.write(auth_string) @@ -776,13 +771,13 @@ CommandParser::CmdParser.new(ARGV) do auth_string = "#{user['NAME']}:#{token}" auth_file = helper.auth_file(auth_string) - # rubocop:disable Lint/HandleExceptions + # rubocop:disable Lint/SuppressedException begin File.unlink(auth_file) puts "Removing #{auth_file}" rescue Errno::ENOENT end - # rubocop:enable Lint/HandleExceptions + # rubocop:enable Lint/SuppressedException 0 end diff --git a/src/hem/onehem-server.rb b/src/hem/onehem-server.rb index 401ca9e044..be99df89c3 100755 --- a/src/hem/onehem-server.rb +++ b/src/hem/onehem-server.rb @@ -202,7 +202,7 @@ module HEMHook '' end rescue StandardError - return '' + '' end end diff --git a/src/oneprovision/lib/resource.rb b/src/oneprovision/lib/resource.rb index 2c9e9f542c..6e0b0ad64c 100644 --- a/src/oneprovision/lib/resource.rb +++ b/src/oneprovision/lib/resource.rb @@ -98,11 +98,11 @@ module OneProvision Utils.exception(@pool.info) if id - return @pool.select do |resource| + @pool.select do |resource| resource['TEMPLATE/PROVISION/PROVISION_ID'] == id end else - return @pool.reject do |resource| + @pool.reject do |resource| resource['TEMPLATE/PROVISION/PROVISION_ID'].nil? end end