Fix auto-gen formatting + RuboCop AutoFix Style/ModuleFunction

This commit is contained in:
Pieter Oliver 2025-07-10 11:26:28 +01:00
parent ba45a7dbf9
commit b338298711
No known key found for this signature in database
GPG key ID: AAC5BA1478582D1F
2 changed files with 22 additions and 30 deletions

View file

@ -1,6 +1,6 @@
# This configuration was generated by # This configuration was generated by
# `rubocop --auto-gen-config` # `rubocop --auto-gen-config`
# on 2025-06-30 11:36:15 UTC using RuboCop version 1.77.0. # on 2025-07-10 10:25:51 UTC using RuboCop version 1.77.0.
# The point is for the user to remove these configuration records # The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base. # one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new # Note that changes in the inspected code, or installation of new
@ -12,7 +12,7 @@
# Include: **/*.gemspec, **/Gemfile, **/gems.rb # Include: **/*.gemspec, **/Gemfile, **/gems.rb
Gemspec/DevelopmentDependencies: Gemspec/DevelopmentDependencies:
Exclude: Exclude:
- "grape_logging.gemspec" - 'grape_logging.gemspec'
# Offense count: 1 # Offense count: 1
# This cop supports safe autocorrection (--autocorrect). # This cop supports safe autocorrection (--autocorrect).
@ -20,7 +20,7 @@ Gemspec/DevelopmentDependencies:
# Include: **/*.gemspec # Include: **/*.gemspec
Gemspec/RequireMFA: Gemspec/RequireMFA:
Exclude: Exclude:
- "grape_logging.gemspec" - 'grape_logging.gemspec'
# Offense count: 1 # Offense count: 1
# Configuration parameters: Severity, Include. # Configuration parameters: Severity, Include.
@ -28,6 +28,7 @@ Gemspec/RequireMFA:
Gemspec/RequiredRubyVersion: Gemspec/RequiredRubyVersion:
Exclude: Exclude:
- 'grape_logging.gemspec' - 'grape_logging.gemspec'
# Offense count: 1 # Offense count: 1
# Configuration parameters: IgnoreLiteralBranches, IgnoreConstantBranches, IgnoreDuplicateElseBranch. # Configuration parameters: IgnoreLiteralBranches, IgnoreConstantBranches, IgnoreDuplicateElseBranch.
Lint/DuplicateBranch: Lint/DuplicateBranch:
@ -38,7 +39,7 @@ Lint/DuplicateBranch:
# Configuration parameters: AllowedParentClasses. # Configuration parameters: AllowedParentClasses.
Lint/MissingSuper: Lint/MissingSuper:
Exclude: Exclude:
- "lib/grape_logging/loggers/filter_parameters.rb" - 'lib/grape_logging/loggers/filter_parameters.rb'
# Offense count: 3 # Offense count: 3
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes. # Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes.
@ -72,16 +73,16 @@ Metrics/PerceivedComplexity:
# AllowedIdentifiers: TLS1_1, TLS1_2, capture3, iso8601, rfc1123_date, rfc822, rfc2822, rfc3339, x86_64 # AllowedIdentifiers: TLS1_1, TLS1_2, capture3, iso8601, rfc1123_date, rfc822, rfc2822, rfc3339, x86_64
Naming/VariableNumber: Naming/VariableNumber:
Exclude: Exclude:
- "spec/lib/grape_logging/formatters/rails_spec.rb" - 'spec/lib/grape_logging/formatters/rails_spec.rb'
# Offense count: 3 # Offense count: 3
# This cop supports unsafe autocorrection (--autocorrect-all). # This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: MinBranchesCount. # Configuration parameters: MinBranchesCount.
Style/CaseLikeIf: Style/CaseLikeIf:
Exclude: Exclude:
- "lib/grape_logging/formatters/default.rb" - 'lib/grape_logging/formatters/default.rb'
- "lib/grape_logging/formatters/logstash.rb" - 'lib/grape_logging/formatters/logstash.rb'
- "lib/grape_logging/formatters/rails.rb" - 'lib/grape_logging/formatters/rails.rb'
# Offense count: 17 # Offense count: 17
# Configuration parameters: AllowedConstants. # Configuration parameters: AllowedConstants.
@ -99,7 +100,7 @@ Style/FrozenStringLiteralComment:
# This cop supports unsafe autocorrection (--autocorrect-all). # This cop supports unsafe autocorrection (--autocorrect-all).
Style/GlobalStdStream: Style/GlobalStdStream:
Exclude: Exclude:
- "lib/grape_logging/reporters/logger_reporter.rb" - 'lib/grape_logging/reporters/logger_reporter.rb'
# Offense count: 1 # Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all). # This cop supports unsafe autocorrection (--autocorrect-all).
@ -109,22 +110,13 @@ Style/MutableConstant:
Exclude: Exclude:
- 'lib/grape_logging/version.rb' - 'lib/grape_logging/version.rb'
# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: EnforcedStyle, AllowedMethods, AllowedPatterns.
# SupportedStyles: predicate, comparison
Style/NumericPredicate:
Exclude:
- "spec/**/*"
- "lib/grape_logging/formatters/rails.rb"
# Offense count: 10 # Offense count: 10
Style/OpenStructUse: Style/OpenStructUse:
Exclude: Exclude:
- "spec/lib/grape_logging/loggers/client_env_spec.rb" - 'spec/lib/grape_logging/loggers/client_env_spec.rb'
- "spec/lib/grape_logging/loggers/filter_parameters_spec.rb" - 'spec/lib/grape_logging/loggers/filter_parameters_spec.rb'
- "spec/lib/grape_logging/loggers/request_headers_spec.rb" - 'spec/lib/grape_logging/loggers/request_headers_spec.rb'
- "spec/lib/grape_logging/loggers/response_spec.rb" - 'spec/lib/grape_logging/loggers/response_spec.rb'
# Offense count: 3 # Offense count: 3
# This cop supports unsafe autocorrection (--autocorrect-all). # This cop supports unsafe autocorrection (--autocorrect-all).
@ -138,7 +130,7 @@ Style/SafeNavigation:
# This cop supports unsafe autocorrection (--autocorrect-all). # This cop supports unsafe autocorrection (--autocorrect-all).
Style/SlicingWithRange: Style/SlicingWithRange:
Exclude: Exclude:
- "lib/grape_logging/loggers/request_headers.rb" - 'lib/grape_logging/loggers/request_headers.rb'
# Offense count: 1 # Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all). # This cop supports unsafe autocorrection (--autocorrect-all).
@ -146,16 +138,16 @@ Style/SlicingWithRange:
# SupportedStyles: use_perl_names, use_english_names, use_builtin_english_names # SupportedStyles: use_perl_names, use_english_names, use_builtin_english_names
Style/SpecialGlobalVars: Style/SpecialGlobalVars:
Exclude: Exclude:
- "spec/spec_helper.rb" - 'spec/spec_helper.rb'
# Offense count: 3 # Offense count: 3
# This cop supports unsafe autocorrection (--autocorrect-all). # This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: Mode. # Configuration parameters: Mode.
Style/StringConcatenation: Style/StringConcatenation:
Exclude: Exclude:
- "lib/grape_logging/formatters/json.rb" - 'lib/grape_logging/formatters/json.rb'
- "lib/grape_logging/formatters/lograge.rb" - 'lib/grape_logging/formatters/lograge.rb'
- "lib/grape_logging/formatters/logstash.rb" - 'lib/grape_logging/formatters/logstash.rb'
# Offense count: 1 # Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all). # This cop supports unsafe autocorrection (--autocorrect-all).
@ -163,11 +155,11 @@ Style/StringConcatenation:
# AllowedMethods: define_method # AllowedMethods: define_method
Style/SymbolProc: Style/SymbolProc:
Exclude: Exclude:
- "lib/grape_logging/util/parameter_filter.rb" - 'lib/grape_logging/util/parameter_filter.rb'
# Offense count: 11 # Offense count: 11
# This cop supports safe autocorrection (--autocorrect). # This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowHeredoc, AllowURI, AllowQualifiedName, URISchemes, IgnoreCopDirectives, AllowedPatterns, SplitStrings. # Configuration parameters: AllowHeredoc, AllowURI, AllowQualifiedName, URISchemes, IgnoreCopDirectives, AllowedPatterns, SplitStrings.
# URISchemes: http, https # URISchemes: http, https
Layout/LineLength: Layout/LineLength:
Max: 203 Max: 203

View file

@ -1,6 +1,6 @@
module GrapeLogging module GrapeLogging
module Timings module Timings
extend self module_function
def db_runtime=(value) def db_runtime=(value)
Thread.current[:grape_db_runtime] = value Thread.current[:grape_db_runtime] = value