From fc7ae9023a6f21303443f1905e6cd93deaa62b4f Mon Sep 17 00:00:00 2001 From: Pieter Oliver Date: Mon, 30 Jun 2025 12:35:23 +0100 Subject: [PATCH] AutoFix RuboCop Layout/IndentationWidth --- .rubocop_todo.yml | 8 -------- lib/grape_logging/middleware/request_logger.rb | 4 ++-- spec/lib/grape_logging/formatters/rails_spec.rb | 4 ++-- 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 23ca9d2..f84d58e 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -29,14 +29,6 @@ Gemspec/RequiredRubyVersion: Exclude: - 'grape_logging.gemspec' -# Offense count: 4 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: Width, AllowedPatterns. -Layout/IndentationWidth: - Exclude: - - 'lib/grape_logging/middleware/request_logger.rb' - - 'spec/lib/grape_logging/formatters/rails_spec.rb' - # Offense count: 1 # This cop supports safe autocorrection (--autocorrect). # Configuration parameters: AllowForAlignment, EnforcedStyleForExponentOperator, EnforcedStyleForRationalLiterals. diff --git a/lib/grape_logging/middleware/request_logger.rb b/lib/grape_logging/middleware/request_logger.rb index 59595f7..b6e112f 100644 --- a/lib/grape_logging/middleware/request_logger.rb +++ b/lib/grape_logging/middleware/request_logger.rb @@ -17,9 +17,9 @@ module GrapeLogging @included_loggers = @options[:include] || [] @reporter = if options[:instrumentation_key] - Reporters::ActiveSupportReporter.new(@options[:instrumentation_key]) + Reporters::ActiveSupportReporter.new(@options[:instrumentation_key]) else - Reporters::LoggerReporter.new(@options[:logger], @options[:formatter], @options[:log_level]) + Reporters::LoggerReporter.new(@options[:logger], @options[:formatter], @options[:log_level]) end end diff --git a/spec/lib/grape_logging/formatters/rails_spec.rb b/spec/lib/grape_logging/formatters/rails_spec.rb index 55399f2..3607502 100644 --- a/spec/lib/grape_logging/formatters/rails_spec.rb +++ b/spec/lib/grape_logging/formatters/rails_spec.rb @@ -63,9 +63,9 @@ describe GrapeLogging::Formatters::Rails do lines = message.split("\n") expected_output = if RUBY_VERSION >= '3.4' - ' Parameters: {"some_param" => {value_1: "123", value_2: "456"}}' + ' Parameters: {"some_param" => {value_1: "123", value_2: "456"}}' else - ' Parameters: {"some_param"=>{:value_1=>"123", :value_2=>"456"}}' + ' Parameters: {"some_param"=>{:value_1=>"123", :value_2=>"456"}}' end expect(lines.first).to eq expected_output expect(lines.last).to eq "Completed 200 OK in 272.4ms (Views: 231.77ms | DB: 40.63ms)"