AutoFix RuboCop Style/IfUnlessModifier

This commit is contained in:
Pieter Oliver 2025-07-08 17:21:32 +01:00
parent 65aa4648b2
commit 4ca251f9a8
No known key found for this signature in database
GPG key ID: AAC5BA1478582D1F
2 changed files with 1 additions and 9 deletions

View file

@ -157,12 +157,6 @@ Style/HashSyntax:
Exclude:
- 'lib/grape_logging/formatters/logstash.rb'
# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
Style/IfUnlessModifier:
Exclude:
- 'lib/grape_logging/reporters/logger_reporter.rb'
# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: EnforcedStyle, Autocorrect.

View file

@ -3,9 +3,7 @@ module Reporters
def initialize(logger, formatter, log_level)
@logger = logger.clone || Logger.new(STDOUT)
@log_level = log_level || :info
if @logger.respond_to?(:formatter=)
@logger.formatter = formatter || @logger.formatter || GrapeLogging::Formatters::Default.new
end
@logger.formatter = formatter || @logger.formatter || GrapeLogging::Formatters::Default.new if @logger.respond_to?(:formatter=)
end
def perform(params)