AutoFix RuboCop Style/HashSyntax

This commit is contained in:
Pieter Oliver 2025-07-08 17:22:12 +01:00
parent 4ca251f9a8
commit f6ae186ea6
No known key found for this signature in database
GPG key ID: AAC5BA1478582D1F
2 changed files with 3 additions and 12 deletions

View file

@ -148,15 +148,6 @@ Style/GuardClause:
Exclude:
- 'lib/grape_logging/reporters/logger_reporter.rb'
# Offense count: 3
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle, EnforcedShorthandSyntax, UseHashRocketsWithSymbolValues, PreferHashRocketsForNonAlnumEndingSymbols.
# SupportedStyles: ruby19, hash_rockets, no_mixed_keys, ruby19_no_mixed_keys
# SupportedShorthandSyntax: always, never, either, consistent, either_consistent
Style/HashSyntax:
Exclude:
- 'lib/grape_logging/formatters/logstash.rb'
# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: EnforcedStyle, Autocorrect.

View file

@ -3,9 +3,9 @@ module GrapeLogging
class Logstash
def call(severity, datetime, _, data)
{
:'@timestamp' => datetime.iso8601,
:'@version' => '1',
:severity => severity
'@timestamp': datetime.iso8601,
'@version': '1',
severity: severity
}.merge!(format(data)).to_json + "\n"
end