From 36e3adfad026a6d38407761d6060941572f2aac7 Mon Sep 17 00:00:00 2001 From: Geremia Taglialatela Date: Sat, 14 Sep 2024 08:53:03 +0200 Subject: [PATCH] Fix Lint/RedundantStringCoercion offenses --- .rubocop_todo.yml | 6 ------ lib/heathen/errors.rb | 2 +- lib/heathen/processor_methods/convert_image.rb | 2 +- 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 8f302db..316f9e9 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -75,12 +75,6 @@ Lint/ParenthesesAsGroupedExpression: Exclude: - 'lib/autoheathen/email_processor.rb' -# This cop supports safe autocorrection (--autocorrect). -Lint/RedundantStringCoercion: - Exclude: - - 'lib/heathen/errors.rb' - - 'lib/heathen/processor_methods/convert_image.rb' - # Configuration parameters: IgnoreImplicitReferences. Lint/ShadowedArgument: Exclude: diff --git a/lib/heathen/errors.rb b/lib/heathen/errors.rb index db624f8..fdf919d 100644 --- a/lib/heathen/errors.rb +++ b/lib/heathen/errors.rb @@ -8,7 +8,7 @@ class Error < StandardError; end # Raised by task [Processor] method when a pre-condition (such as mime-type) is not valid. class ExpectationNotMet < Error def initialize(name, value, pattern) - super "Expectation failure on #{name}, expected '#{value.to_s}' to match /#{pattern.to_s}/" + super "Expectation failure on #{name}, expected '#{value}' to match /#{pattern}/" end end diff --git a/lib/heathen/processor_methods/convert_image.rb b/lib/heathen/processor_methods/convert_image.rb index ce9994f..d04f8a7 100644 --- a/lib/heathen/processor_methods/convert_image.rb +++ b/lib/heathen/processor_methods/convert_image.rb @@ -7,7 +7,7 @@ class Processor def convert_image(to: 'tiff', params: '') expect_mime_type 'image/*' - target_file = temp_file_name '', ".#{to.to_s}" + target_file = temp_file_name '', ".#{to}" executioner.execute( *[ Colore::C_.convert_path,