From 5b1b558a5aa4bcf5aa15af78e508dc3cfb74ccc7 Mon Sep 17 00:00:00 2001 From: Stan Lo Date: Mon, 7 Oct 2024 20:39:24 +0800 Subject: [PATCH] Consistent string freezing (#2422) --- .rubocop.yml | 10 ++++++++++ CHANGELOG.md | 1 + Gemfile | 2 ++ sentry-delayed_job/Gemfile | 2 ++ sentry-delayed_job/Rakefile | 2 ++ sentry-delayed_job/bin/console | 1 + sentry-delayed_job/example/Gemfile | 2 ++ sentry-delayed_job/example/app.rb | 2 ++ sentry-delayed_job/lib/sentry-delayed_job.rb | 2 ++ .../lib/sentry/delayed_job/configuration.rb | 2 ++ .../lib/sentry/delayed_job/version.rb | 2 ++ sentry-delayed_job/sentry-delayed_job.gemspec | 2 ++ .../sentry/delayed_job/configuration_spec.rb | 2 ++ .../spec/sentry/delayed_job_spec.rb | 2 ++ sentry-delayed_job/spec/spec_helper.rb | 2 ++ sentry-opentelemetry/Gemfile | 2 ++ sentry-opentelemetry/Rakefile | 2 ++ sentry-rails/Gemfile | 2 ++ sentry-rails/Rakefile | 2 ++ sentry-rails/app/jobs/sentry/send_event_job.rb | 2 ++ sentry-rails/benchmarks/allocation_comparison.rb | 2 ++ sentry-rails/benchmarks/allocation_report.rb | 2 ++ sentry-rails/benchmarks/application.rb | 2 ++ sentry-rails/bin/console | 1 + sentry-rails/lib/generators/sentry_generator.rb | 2 ++ sentry-rails/lib/sentry-rails.rb | 2 ++ sentry-rails/lib/sentry/rails.rb | 2 ++ sentry-rails/lib/sentry/rails/action_cable.rb | 4 +++- sentry-rails/lib/sentry/rails/active_job.rb | 6 ++++-- .../lib/sentry/rails/background_worker.rb | 2 ++ .../lib/sentry/rails/backtrace_cleaner.rb | 6 ++++-- .../rails/breadcrumb/active_support_logger.rb | 2 ++ .../monotonic_active_support_logger.rb | 2 ++ .../lib/sentry/rails/capture_exceptions.rb | 6 ++++-- sentry-rails/lib/sentry/rails/configuration.rb | 2 ++ .../lib/sentry/rails/controller_methods.rb | 2 ++ .../lib/sentry/rails/controller_transaction.rb | 4 +++- sentry-rails/lib/sentry/rails/engine.rb | 2 ++ .../lib/sentry/rails/error_subscriber.rb | 2 ++ .../rails/instrument_payload_cleanup_helper.rb | 2 ++ .../sentry/rails/overrides/streaming_reporter.rb | 2 ++ sentry-rails/lib/sentry/rails/railtie.rb | 2 ++ .../rails/rescued_exception_interceptor.rb | 2 ++ sentry-rails/lib/sentry/rails/tracing.rb | 2 ++ .../sentry/rails/tracing/abstract_subscriber.rb | 2 ++ .../tracing/action_controller_subscriber.rb | 6 ++++-- .../rails/tracing/action_view_subscriber.rb | 6 ++++-- .../rails/tracing/active_storage_subscriber.rb | 6 ++++-- sentry-rails/lib/sentry/rails/version.rb | 2 ++ sentry-rails/sentry-rails.gemspec | 2 ++ sentry-rails/spec/dummy/test_rails_app/app.rb | 2 ++ .../spec/dummy/test_rails_app/apps/5-0.rb | 2 ++ .../spec/dummy/test_rails_app/apps/5-2.rb | 2 ++ .../spec/dummy/test_rails_app/apps/6-0.rb | 2 ++ .../spec/dummy/test_rails_app/apps/6-1.rb | 2 ++ .../spec/dummy/test_rails_app/apps/7-0.rb | 2 ++ .../spec/dummy/test_rails_app/apps/7-1.rb | 2 ++ .../spec/dummy/test_rails_app/configs/5-0.rb | 2 ++ .../spec/dummy/test_rails_app/configs/5-2.rb | 2 ++ .../spec/dummy/test_rails_app/configs/6-0.rb | 2 ++ .../spec/dummy/test_rails_app/configs/6-1.rb | 2 ++ .../spec/dummy/test_rails_app/configs/7-0.rb | 2 ++ .../spec/dummy/test_rails_app/configs/7-1.rb | 2 ++ .../spec/dummy/test_rails_app/configs/7-2.rb | 2 ++ .../spec/sentry/rails/action_cable_spec.rb | 2 ++ sentry-rails/spec/sentry/rails/activejob_spec.rb | 2 ++ .../breadcrumbs/active_support_logger_spec.rb | 2 ++ .../monotonic_active_support_logger_spec.rb | 2 ++ sentry-rails/spec/sentry/rails/client_spec.rb | 2 ++ .../spec/sentry/rails/configuration_spec.rb | 2 ++ .../spec/sentry/rails/controller_methods_spec.rb | 2 ++ .../spec/sentry/rails/error_subscriber_spec.rb | 2 ++ sentry-rails/spec/sentry/rails/event_spec.rb | 2 ++ .../tracing/action_controller_subscriber_spec.rb | 2 ++ .../rails/tracing/action_view_subscriber_spec.rb | 2 ++ .../tracing/active_record_subscriber_spec.rb | 2 ++ .../tracing/active_storage_subscriber_spec.rb | 2 ++ sentry-rails/spec/sentry/rails/tracing_spec.rb | 2 ++ sentry-rails/spec/sentry/rails_spec.rb | 2 ++ sentry-rails/spec/sentry/send_event_job_spec.rb | 2 ++ sentry-rails/spec/spec_helper.rb | 2 ++ sentry-resque/Gemfile | 2 ++ sentry-resque/Gemfile_with_rails.rb | 2 ++ sentry-resque/Rakefile | 2 ++ sentry-resque/bin/console | 1 + sentry-resque/example/Gemfile | 2 ++ sentry-resque/example/app.rb | 2 ++ sentry-resque/lib/sentry-resque.rb | 2 ++ sentry-resque/lib/sentry/resque/configuration.rb | 2 ++ sentry-resque/lib/sentry/resque/version.rb | 2 ++ sentry-resque/sentry-resque.gemspec | 2 ++ .../spec/sentry/resque/configuration_spec.rb | 2 ++ sentry-resque/spec/sentry/resque_spec.rb | 2 ++ sentry-resque/spec/sentry/tracing_spec.rb | 2 ++ sentry-resque/spec/spec_helper.rb | 2 ++ sentry-ruby/.rubocop.yml | 1 + sentry-ruby/Gemfile | 2 ++ sentry-ruby/Rakefile | 2 ++ sentry-ruby/benchmarks/allocation_comparison.rb | 2 ++ sentry-ruby/benchmarks/allocation_report.rb | 2 ++ .../benchmarks/exception_locals_capturing.rb | 2 ++ sentry-ruby/bin/console | 1 + sentry-ruby/lib/sentry-ruby.rb | 6 +++--- sentry-ruby/lib/sentry/backtrace.rb | 4 ++-- sentry-ruby/lib/sentry/baggage.rb | 2 +- sentry-ruby/lib/sentry/configuration.rb | 10 +++++----- sentry-ruby/lib/sentry/cron/monitor_check_ins.rb | 2 ++ .../lib/sentry/interfaces/single_exception.rb | 4 ++-- .../lib/sentry/rack/capture_exceptions.rb | 2 +- sentry-ruby/lib/sentry/test_helper.rb | 2 ++ sentry-ruby/lib/sentry/transaction.rb | 2 +- sentry-ruby/sentry-ruby-core.gemspec | 2 ++ sentry-ruby/sentry-ruby.gemspec | 2 ++ sentry-ruby/spec/contexts/with_request_mock.rb | 2 ++ sentry-ruby/spec/initialization_check_spec.rb | 2 ++ sentry-ruby/spec/isolated/puma_spec.rb | 2 ++ .../spec/sentry/background_worker_spec.rb | 2 ++ .../spec/sentry/backpressure_monitor_spec.rb | 2 ++ sentry-ruby/spec/sentry/backtrace/lines_spec.rb | 2 ++ sentry-ruby/spec/sentry/backtrace_spec.rb | 2 ++ sentry-ruby/spec/sentry/baggage_spec.rb | 2 ++ .../spec/sentry/breadcrumb/http_logger_spec.rb | 2 ++ .../spec/sentry/breadcrumb/redis_logger_spec.rb | 2 ++ .../spec/sentry/breadcrumb/sentry_logger_spec.rb | 2 ++ .../spec/sentry/breadcrumb_buffer_spec.rb | 2 ++ sentry-ruby/spec/sentry/breadcrumb_spec.rb | 2 ++ .../spec/sentry/client/event_sending_spec.rb | 2 ++ sentry-ruby/spec/sentry/client_spec.rb | 9 ++++++++- sentry-ruby/spec/sentry/configuration_spec.rb | 2 ++ .../spec/sentry/cron/monitor_check_ins_spec.rb | 2 ++ .../spec/sentry/cron/monitor_config_spec.rb | 2 ++ .../spec/sentry/cron/monitor_schedule_spec.rb | 2 ++ sentry-ruby/spec/sentry/dsn_spec.rb | 2 ++ sentry-ruby/spec/sentry/envelope/item_spec.rb | 2 ++ sentry-ruby/spec/sentry/event_spec.rb | 2 ++ sentry-ruby/spec/sentry/faraday_spec.rb | 2 ++ sentry-ruby/spec/sentry/graphql_spec.rb | 2 ++ sentry-ruby/spec/sentry/hub_spec.rb | 2 ++ sentry-ruby/spec/sentry/integrable_spec.rb | 2 ++ sentry-ruby/spec/sentry/interface_spec.rb | 2 ++ .../sentry/interfaces/request_interface_spec.rb | 2 ++ .../sentry/interfaces/stacktrace_builder_spec.rb | 16 +++++++++------- .../spec/sentry/interfaces/stacktrace_spec.rb | 2 ++ sentry-ruby/spec/sentry/linecache_spec.rb | 2 ++ .../spec/sentry/metrics/aggregator_spec.rb | 2 ++ .../spec/sentry/metrics/configuration_spec.rb | 2 ++ .../spec/sentry/metrics/counter_metric_spec.rb | 2 ++ .../sentry/metrics/distribution_metric_spec.rb | 2 ++ .../spec/sentry/metrics/gauge_metric_spec.rb | 2 ++ .../spec/sentry/metrics/local_aggregator_spec.rb | 2 ++ sentry-ruby/spec/sentry/metrics/metric_spec.rb | 2 ++ .../spec/sentry/metrics/set_metric_spec.rb | 2 ++ sentry-ruby/spec/sentry/metrics/timing_spec.rb | 2 ++ sentry-ruby/spec/sentry/metrics_spec.rb | 2 ++ sentry-ruby/spec/sentry/net/http_spec.rb | 2 ++ sentry-ruby/spec/sentry/profiler_spec.rb | 2 ++ .../spec/sentry/propagation_context_spec.rb | 2 ++ .../spec/sentry/rack/capture_exceptions_spec.rb | 2 ++ sentry-ruby/spec/sentry/rake_spec.rb | 2 ++ sentry-ruby/spec/sentry/redis_spec.rb | 2 ++ sentry-ruby/spec/sentry/scope/setters_spec.rb | 2 ++ sentry-ruby/spec/sentry/scope_spec.rb | 2 ++ sentry-ruby/spec/sentry/session_flusher_spec.rb | 2 ++ sentry-ruby/spec/sentry/span_spec.rb | 2 ++ sentry-ruby/spec/sentry/test_helper_spec.rb | 2 ++ sentry-ruby/spec/sentry/transaction_spec.rb | 2 ++ .../spec/sentry/transport/configuration_spec.rb | 2 ++ .../http_transport_rate_limiting_spec.rb | 2 ++ .../spec/sentry/transport/http_transport_spec.rb | 2 ++ .../sentry/transport/spotlight_transport_spec.rb | 2 ++ sentry-ruby/spec/sentry/transport_spec.rb | 2 ++ sentry-ruby/spec/sentry/utils/real_ip_spec.rb | 2 ++ sentry-ruby/spec/sentry/utils/request_id_spec.rb | 2 ++ sentry-ruby/spec/sentry/vernier/profiler_spec.rb | 6 ++++-- sentry-ruby/spec/sentry_spec.rb | 2 ++ sentry-ruby/spec/spec_helper.rb | 2 ++ sentry-ruby/spec/support/Rakefile.rb | 2 ++ sentry-ruby/spec/support/profiler.rb | 2 ++ .../spec/support/stacktrace_test_fixture.rb | 2 ++ sentry-sidekiq/Gemfile | 2 ++ sentry-sidekiq/Rakefile | 2 ++ sentry-sidekiq/bin/console | 1 + sentry-sidekiq/example/Gemfile | 2 ++ sentry-sidekiq/example/error_worker.rb | 2 ++ sentry-sidekiq/lib/sentry-sidekiq.rb | 2 ++ .../lib/sentry/sidekiq/configuration.rb | 2 ++ .../lib/sentry/sidekiq/context_filter.rb | 6 ++++-- .../lib/sentry/sidekiq/error_handler.rb | 2 ++ sentry-sidekiq/lib/sentry/sidekiq/version.rb | 2 ++ sentry-sidekiq/sentry-sidekiq.gemspec | 2 ++ sentry-sidekiq/spec/sentry/rails_spec.rb | 2 ++ .../sentry/sidekiq-scheduler/scheduler_spec.rb | 2 ++ .../spec/sentry/sidekiq/configuration_spec.rb | 2 ++ .../spec/sentry/sidekiq/context_filter_spec.rb | 2 ++ .../spec/sentry/sidekiq/cron/job_spec.rb | 2 ++ .../spec/sentry/sidekiq/error_handler_spec.rb | 2 ++ .../sidekiq/sentry_context_middleware_spec.rb | 2 ++ sentry-sidekiq/spec/sentry/sidekiq_spec.rb | 2 ++ sentry-sidekiq/spec/spec_helper.rb | 2 ++ 199 files changed, 431 insertions(+), 41 deletions(-) create mode 120000 sentry-ruby/.rubocop.yml diff --git a/.rubocop.yml b/.rubocop.yml index 451fd8589..9286a27d3 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -4,7 +4,17 @@ inherit_gem: Layout/SpaceInsideArrayLiteralBrackets: Enabled: false +Layout/EmptyLineAfterMagicComment: + Enabled: true + +Style/FrozenStringLiteralComment: + Enabled: true + +Style/RedundantFreeze: + Enabled: true + AllCops: Exclude: - "sentry-raven/**/*" - "sentry-*/tmp/**/*" + - "sentry-*/examples/**/*" diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f0aa6444..35975b8dd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ ### Internal - Profile items have bigger size limit now ([#2421](https://github.com/getsentry/sentry-ruby/pull/2421)) +- Consistent string freezing ([#2422](https://github.com/getsentry/sentry-ruby/pull/2422)) ## 5.20.1 diff --git a/Gemfile b/Gemfile index c897e543f..9847a55e8 100644 --- a/Gemfile +++ b/Gemfile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + source "https://rubygems.org" git_source(:github) { |name| "https://github.com/#{name}.git" } diff --git a/sentry-delayed_job/Gemfile b/sentry-delayed_job/Gemfile index 936bec48a..48e80fbdc 100644 --- a/sentry-delayed_job/Gemfile +++ b/sentry-delayed_job/Gemfile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + source "https://rubygems.org" git_source(:github) { |name| "https://github.com/#{name}.git" } diff --git a/sentry-delayed_job/Rakefile b/sentry-delayed_job/Rakefile index 7b2756854..13afab191 100644 --- a/sentry-delayed_job/Rakefile +++ b/sentry-delayed_job/Rakefile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "bundler/gem_tasks" require "rspec/core/rake_task" diff --git a/sentry-delayed_job/bin/console b/sentry-delayed_job/bin/console index 660c7a889..f0f5a7b6a 100755 --- a/sentry-delayed_job/bin/console +++ b/sentry-delayed_job/bin/console @@ -1,4 +1,5 @@ #!/usr/bin/env ruby +# frozen_string_literal: true require "bundler/setup" require "sentry/ruby" diff --git a/sentry-delayed_job/example/Gemfile b/sentry-delayed_job/example/Gemfile index 2ed843ab1..d138c16d5 100644 --- a/sentry-delayed_job/example/Gemfile +++ b/sentry-delayed_job/example/Gemfile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + source "https://rubygems.org" gem "rails" diff --git a/sentry-delayed_job/example/app.rb b/sentry-delayed_job/example/app.rb index bcec27c52..04f391468 100644 --- a/sentry-delayed_job/example/app.rb +++ b/sentry-delayed_job/example/app.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "active_job" require "active_record" require "delayed_job" diff --git a/sentry-delayed_job/lib/sentry-delayed_job.rb b/sentry-delayed_job/lib/sentry-delayed_job.rb index f96b03b6a..bc961259f 100644 --- a/sentry-delayed_job/lib/sentry-delayed_job.rb +++ b/sentry-delayed_job/lib/sentry-delayed_job.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "delayed_job" require "sentry-ruby" require "sentry/integrable" diff --git a/sentry-delayed_job/lib/sentry/delayed_job/configuration.rb b/sentry-delayed_job/lib/sentry/delayed_job/configuration.rb index 4408b37af..42ee8e63c 100644 --- a/sentry-delayed_job/lib/sentry/delayed_job/configuration.rb +++ b/sentry-delayed_job/lib/sentry/delayed_job/configuration.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Sentry class Configuration attr_reader :delayed_job diff --git a/sentry-delayed_job/lib/sentry/delayed_job/version.rb b/sentry-delayed_job/lib/sentry/delayed_job/version.rb index e5c1c5e5f..69dc33410 100644 --- a/sentry-delayed_job/lib/sentry/delayed_job/version.rb +++ b/sentry-delayed_job/lib/sentry/delayed_job/version.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Sentry module DelayedJob VERSION = "5.20.1" diff --git a/sentry-delayed_job/sentry-delayed_job.gemspec b/sentry-delayed_job/sentry-delayed_job.gemspec index e9c004738..cd55d35dd 100644 --- a/sentry-delayed_job/sentry-delayed_job.gemspec +++ b/sentry-delayed_job/sentry-delayed_job.gemspec @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "lib/sentry/delayed_job/version" Gem::Specification.new do |spec| diff --git a/sentry-delayed_job/spec/sentry/delayed_job/configuration_spec.rb b/sentry-delayed_job/spec/sentry/delayed_job/configuration_spec.rb index fdde5b4f5..a785f53c3 100644 --- a/sentry-delayed_job/spec/sentry/delayed_job/configuration_spec.rb +++ b/sentry-delayed_job/spec/sentry/delayed_job/configuration_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "spec_helper" RSpec.describe Sentry::DelayedJob::Configuration do diff --git a/sentry-delayed_job/spec/sentry/delayed_job_spec.rb b/sentry-delayed_job/spec/sentry/delayed_job_spec.rb index ac2d31fb1..24a1de77d 100644 --- a/sentry-delayed_job/spec/sentry/delayed_job_spec.rb +++ b/sentry-delayed_job/spec/sentry/delayed_job_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "spec_helper" RSpec.describe Sentry::DelayedJob do diff --git a/sentry-delayed_job/spec/spec_helper.rb b/sentry-delayed_job/spec/spec_helper.rb index 2d8bf6d10..3e07723bb 100644 --- a/sentry-delayed_job/spec/spec_helper.rb +++ b/sentry-delayed_job/spec/spec_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "bundler/setup" begin require "debug/prelude" diff --git a/sentry-opentelemetry/Gemfile b/sentry-opentelemetry/Gemfile index e084c17c6..b30d36d42 100644 --- a/sentry-opentelemetry/Gemfile +++ b/sentry-opentelemetry/Gemfile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + source "https://rubygems.org" git_source(:github) { |name| "https://github.com/#{name}.git" } diff --git a/sentry-opentelemetry/Rakefile b/sentry-opentelemetry/Rakefile index 7b2756854..13afab191 100644 --- a/sentry-opentelemetry/Rakefile +++ b/sentry-opentelemetry/Rakefile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "bundler/gem_tasks" require "rspec/core/rake_task" diff --git a/sentry-rails/Gemfile b/sentry-rails/Gemfile index e203e41a1..7695eff15 100644 --- a/sentry-rails/Gemfile +++ b/sentry-rails/Gemfile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + source "https://rubygems.org" git_source(:github) { |name| "https://github.com/#{name}.git" } diff --git a/sentry-rails/Rakefile b/sentry-rails/Rakefile index 2624fb72e..d58f59ad2 100644 --- a/sentry-rails/Rakefile +++ b/sentry-rails/Rakefile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "bundler/gem_tasks" require "rspec/core/rake_task" diff --git a/sentry-rails/app/jobs/sentry/send_event_job.rb b/sentry-rails/app/jobs/sentry/send_event_job.rb index 75ac80529..06ca59172 100644 --- a/sentry-rails/app/jobs/sentry/send_event_job.rb +++ b/sentry-rails/app/jobs/sentry/send_event_job.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + if defined?(ActiveJob) module Sentry parent_job = diff --git a/sentry-rails/benchmarks/allocation_comparison.rb b/sentry-rails/benchmarks/allocation_comparison.rb index f2499d937..15b1e3c4a 100644 --- a/sentry-rails/benchmarks/allocation_comparison.rb +++ b/sentry-rails/benchmarks/allocation_comparison.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'benchmark/memory' require "sentry-ruby" require "sentry/benchmarks/benchmark_transport" diff --git a/sentry-rails/benchmarks/allocation_report.rb b/sentry-rails/benchmarks/allocation_report.rb index 13fee1513..9bc691a26 100644 --- a/sentry-rails/benchmarks/allocation_report.rb +++ b/sentry-rails/benchmarks/allocation_report.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'benchmark/ipsa' require "sentry-ruby" require "sentry/benchmarks/benchmark_transport" diff --git a/sentry-rails/benchmarks/application.rb b/sentry-rails/benchmarks/application.rb index fa4d3f5e8..0ef435cee 100644 --- a/sentry-rails/benchmarks/application.rb +++ b/sentry-rails/benchmarks/application.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "active_support/all" require "action_controller" require_relative "../spec/support/test_rails_app/app" diff --git a/sentry-rails/bin/console b/sentry-rails/bin/console index 660c7a889..f0f5a7b6a 100755 --- a/sentry-rails/bin/console +++ b/sentry-rails/bin/console @@ -1,4 +1,5 @@ #!/usr/bin/env ruby +# frozen_string_literal: true require "bundler/setup" require "sentry/ruby" diff --git a/sentry-rails/lib/generators/sentry_generator.rb b/sentry-rails/lib/generators/sentry_generator.rb index de694e40d..e293dae95 100644 --- a/sentry-rails/lib/generators/sentry_generator.rb +++ b/sentry-rails/lib/generators/sentry_generator.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "rails/generators/base" class SentryGenerator < ::Rails::Generators::Base diff --git a/sentry-rails/lib/sentry-rails.rb b/sentry-rails/lib/sentry-rails.rb index c436e1dfa..a8d6499b1 100644 --- a/sentry-rails/lib/sentry-rails.rb +++ b/sentry-rails/lib/sentry-rails.rb @@ -1,2 +1,4 @@ +# frozen_string_literal: true + require "sentry/rails/version" require "sentry/rails" diff --git a/sentry-rails/lib/sentry/rails.rb b/sentry-rails/lib/sentry/rails.rb index 14c8e1b80..b4b79dd85 100644 --- a/sentry-rails/lib/sentry/rails.rb +++ b/sentry-rails/lib/sentry/rails.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "rails" require "sentry-ruby" require "sentry/integrable" diff --git a/sentry-rails/lib/sentry/rails/action_cable.rb b/sentry-rails/lib/sentry/rails/action_cable.rb index 06833a68b..222aab1b8 100644 --- a/sentry-rails/lib/sentry/rails/action_cable.rb +++ b/sentry-rails/lib/sentry/rails/action_cable.rb @@ -1,8 +1,10 @@ +# frozen_string_literal: true + module Sentry module Rails module ActionCableExtensions class ErrorHandler - OP_NAME = "websocket.server".freeze + OP_NAME = "websocket.server" SPAN_ORIGIN = "auto.http.rails.actioncable" class << self diff --git a/sentry-rails/lib/sentry/rails/active_job.rb b/sentry-rails/lib/sentry/rails/active_job.rb index afdf87cd7..953af632b 100644 --- a/sentry-rails/lib/sentry/rails/active_job.rb +++ b/sentry-rails/lib/sentry/rails/active_job.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Sentry module Rails module ActiveJobExtensions @@ -16,8 +18,8 @@ def already_supported_by_sentry_integration? end class SentryReporter - OP_NAME = "queue.active_job".freeze - SPAN_ORIGIN = "auto.queue.active_job".freeze + OP_NAME = "queue.active_job" + SPAN_ORIGIN = "auto.queue.active_job" class << self def record(job, &block) diff --git a/sentry-rails/lib/sentry/rails/background_worker.rb b/sentry-rails/lib/sentry/rails/background_worker.rb index 56dcd6609..2c0cc7a71 100644 --- a/sentry-rails/lib/sentry/rails/background_worker.rb +++ b/sentry-rails/lib/sentry/rails/background_worker.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Sentry class BackgroundWorker def _perform(&block) diff --git a/sentry-rails/lib/sentry/rails/backtrace_cleaner.rb b/sentry-rails/lib/sentry/rails/backtrace_cleaner.rb index 25812b97a..57030f733 100644 --- a/sentry-rails/lib/sentry/rails/backtrace_cleaner.rb +++ b/sentry-rails/lib/sentry/rails/backtrace_cleaner.rb @@ -1,11 +1,13 @@ +# frozen_string_literal: true + require "active_support/backtrace_cleaner" require "active_support/core_ext/string/access" module Sentry module Rails class BacktraceCleaner < ActiveSupport::BacktraceCleaner - APP_DIRS_PATTERN = /\A(?:\.\/)?(?:app|config|lib|test|\(\w*\))/.freeze - RENDER_TEMPLATE_PATTERN = /:in `.*_\w+_{2,3}\d+_\d+'/.freeze + APP_DIRS_PATTERN = /\A(?:\.\/)?(?:app|config|lib|test|\(\w*\))/ + RENDER_TEMPLATE_PATTERN = /:in `.*_\w+_{2,3}\d+_\d+'/ def initialize super diff --git a/sentry-rails/lib/sentry/rails/breadcrumb/active_support_logger.rb b/sentry-rails/lib/sentry/rails/breadcrumb/active_support_logger.rb index 9dfdd1d26..a301cb960 100644 --- a/sentry-rails/lib/sentry/rails/breadcrumb/active_support_logger.rb +++ b/sentry-rails/lib/sentry/rails/breadcrumb/active_support_logger.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Sentry module Rails module Breadcrumb diff --git a/sentry-rails/lib/sentry/rails/breadcrumb/monotonic_active_support_logger.rb b/sentry-rails/lib/sentry/rails/breadcrumb/monotonic_active_support_logger.rb index 71785d256..541f9bea3 100644 --- a/sentry-rails/lib/sentry/rails/breadcrumb/monotonic_active_support_logger.rb +++ b/sentry-rails/lib/sentry/rails/breadcrumb/monotonic_active_support_logger.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "sentry/rails/instrument_payload_cleanup_helper" module Sentry diff --git a/sentry-rails/lib/sentry/rails/capture_exceptions.rb b/sentry-rails/lib/sentry/rails/capture_exceptions.rb index 3216d2a3a..f571bd689 100644 --- a/sentry-rails/lib/sentry/rails/capture_exceptions.rb +++ b/sentry-rails/lib/sentry/rails/capture_exceptions.rb @@ -1,8 +1,10 @@ +# frozen_string_literal: true + module Sentry module Rails class CaptureExceptions < Sentry::Rack::CaptureExceptions RAILS_7_1 = Gem::Version.new(::Rails.version) >= Gem::Version.new("7.1.0.alpha") - SPAN_ORIGIN = "auto.http.rails".freeze + SPAN_ORIGIN = "auto.http.rails" def initialize(_) super @@ -20,7 +22,7 @@ def collect_exception(env) end def transaction_op - "http.server".freeze + "http.server" end def capture_exception(exception, env) diff --git a/sentry-rails/lib/sentry/rails/configuration.rb b/sentry-rails/lib/sentry/rails/configuration.rb index 609e03ca4..2e4591947 100644 --- a/sentry-rails/lib/sentry/rails/configuration.rb +++ b/sentry-rails/lib/sentry/rails/configuration.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "sentry/rails/tracing/action_controller_subscriber" require "sentry/rails/tracing/action_view_subscriber" require "sentry/rails/tracing/active_record_subscriber" diff --git a/sentry-rails/lib/sentry/rails/controller_methods.rb b/sentry-rails/lib/sentry/rails/controller_methods.rb index 90330e946..aa8b4f3e4 100644 --- a/sentry-rails/lib/sentry/rails/controller_methods.rb +++ b/sentry-rails/lib/sentry/rails/controller_methods.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Sentry module Rails module ControllerMethods diff --git a/sentry-rails/lib/sentry/rails/controller_transaction.rb b/sentry-rails/lib/sentry/rails/controller_transaction.rb index cd3ffa38b..8f19bb63d 100644 --- a/sentry-rails/lib/sentry/rails/controller_transaction.rb +++ b/sentry-rails/lib/sentry/rails/controller_transaction.rb @@ -1,7 +1,9 @@ +# frozen_string_literal: true + module Sentry module Rails module ControllerTransaction - SPAN_ORIGIN = "auto.view.rails".freeze + SPAN_ORIGIN = "auto.view.rails" def self.included(base) base.prepend_around_action(:sentry_around_action) diff --git a/sentry-rails/lib/sentry/rails/engine.rb b/sentry-rails/lib/sentry/rails/engine.rb index 12ac173a7..dc50819cd 100644 --- a/sentry-rails/lib/sentry/rails/engine.rb +++ b/sentry-rails/lib/sentry/rails/engine.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Sentry class Engine < ::Rails::Engine isolate_namespace Sentry diff --git a/sentry-rails/lib/sentry/rails/error_subscriber.rb b/sentry-rails/lib/sentry/rails/error_subscriber.rb index fac675dbf..dad598c51 100644 --- a/sentry-rails/lib/sentry/rails/error_subscriber.rb +++ b/sentry-rails/lib/sentry/rails/error_subscriber.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Sentry module Rails # This is not a user-facing class. You should use it with Rails 7.0's error reporter feature and its interfaces. diff --git a/sentry-rails/lib/sentry/rails/instrument_payload_cleanup_helper.rb b/sentry-rails/lib/sentry/rails/instrument_payload_cleanup_helper.rb index 343d2d41c..07422c5e8 100644 --- a/sentry-rails/lib/sentry/rails/instrument_payload_cleanup_helper.rb +++ b/sentry-rails/lib/sentry/rails/instrument_payload_cleanup_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Sentry module Rails module InstrumentPayloadCleanupHelper diff --git a/sentry-rails/lib/sentry/rails/overrides/streaming_reporter.rb b/sentry-rails/lib/sentry/rails/overrides/streaming_reporter.rb index 5ce0c637b..1fdd4ad60 100644 --- a/sentry-rails/lib/sentry/rails/overrides/streaming_reporter.rb +++ b/sentry-rails/lib/sentry/rails/overrides/streaming_reporter.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Sentry module Rails module Overrides diff --git a/sentry-rails/lib/sentry/rails/railtie.rb b/sentry-rails/lib/sentry/rails/railtie.rb index e4926cc0f..0a0cdf213 100644 --- a/sentry-rails/lib/sentry/rails/railtie.rb +++ b/sentry-rails/lib/sentry/rails/railtie.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "sentry/rails/capture_exceptions" require "sentry/rails/rescued_exception_interceptor" require "sentry/rails/backtrace_cleaner" diff --git a/sentry-rails/lib/sentry/rails/rescued_exception_interceptor.rb b/sentry-rails/lib/sentry/rails/rescued_exception_interceptor.rb index 2c977dba4..43cb69db1 100644 --- a/sentry-rails/lib/sentry/rails/rescued_exception_interceptor.rb +++ b/sentry-rails/lib/sentry/rails/rescued_exception_interceptor.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Sentry module Rails class RescuedExceptionInterceptor diff --git a/sentry-rails/lib/sentry/rails/tracing.rb b/sentry-rails/lib/sentry/rails/tracing.rb index 3c5ae2222..82509ab8b 100644 --- a/sentry-rails/lib/sentry/rails/tracing.rb +++ b/sentry-rails/lib/sentry/rails/tracing.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Sentry module Rails module Tracing diff --git a/sentry-rails/lib/sentry/rails/tracing/abstract_subscriber.rb b/sentry-rails/lib/sentry/rails/tracing/abstract_subscriber.rb index fec3f7bde..7ba338c6b 100644 --- a/sentry-rails/lib/sentry/rails/tracing/abstract_subscriber.rb +++ b/sentry-rails/lib/sentry/rails/tracing/abstract_subscriber.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Sentry module Rails module Tracing diff --git a/sentry-rails/lib/sentry/rails/tracing/action_controller_subscriber.rb b/sentry-rails/lib/sentry/rails/tracing/action_controller_subscriber.rb index 11e9eadf2..42b89ce32 100644 --- a/sentry-rails/lib/sentry/rails/tracing/action_controller_subscriber.rb +++ b/sentry-rails/lib/sentry/rails/tracing/action_controller_subscriber.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "sentry/rails/tracing/abstract_subscriber" require "sentry/rails/instrument_payload_cleanup_helper" @@ -8,8 +10,8 @@ class ActionControllerSubscriber < AbstractSubscriber extend InstrumentPayloadCleanupHelper EVENT_NAMES = ["process_action.action_controller"].freeze - OP_NAME = "view.process_action.action_controller".freeze - SPAN_ORIGIN = "auto.view.rails".freeze + OP_NAME = "view.process_action.action_controller" + SPAN_ORIGIN = "auto.view.rails" def self.subscribe! Sentry.logger.warn <<~MSG diff --git a/sentry-rails/lib/sentry/rails/tracing/action_view_subscriber.rb b/sentry-rails/lib/sentry/rails/tracing/action_view_subscriber.rb index baed2c7e5..3f56d72ac 100644 --- a/sentry-rails/lib/sentry/rails/tracing/action_view_subscriber.rb +++ b/sentry-rails/lib/sentry/rails/tracing/action_view_subscriber.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "sentry/rails/tracing/abstract_subscriber" module Sentry @@ -5,8 +7,8 @@ module Rails module Tracing class ActionViewSubscriber < AbstractSubscriber EVENT_NAMES = ["render_template.action_view"].freeze - SPAN_PREFIX = "template.".freeze - SPAN_ORIGIN = "auto.template.rails".freeze + SPAN_PREFIX = "template." + SPAN_ORIGIN = "auto.template.rails" def self.subscribe! subscribe_to_event(EVENT_NAMES) do |event_name, duration, payload| diff --git a/sentry-rails/lib/sentry/rails/tracing/active_storage_subscriber.rb b/sentry-rails/lib/sentry/rails/tracing/active_storage_subscriber.rb index 5d62bad22..50ee0d703 100644 --- a/sentry-rails/lib/sentry/rails/tracing/active_storage_subscriber.rb +++ b/sentry-rails/lib/sentry/rails/tracing/active_storage_subscriber.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "sentry/rails/tracing/abstract_subscriber" module Sentry @@ -19,12 +21,12 @@ class ActiveStorageSubscriber < AbstractSubscriber analyze.active_storage ].freeze - SPAN_ORIGIN = "auto.file.rails".freeze + SPAN_ORIGIN = "auto.file.rails" def self.subscribe! subscribe_to_event(EVENT_NAMES) do |event_name, duration, payload| record_on_current_span( - op: "file.#{event_name}".freeze, + op: "file.#{event_name}", origin: SPAN_ORIGIN, start_timestamp: payload[START_TIMESTAMP_NAME], description: payload[:service], diff --git a/sentry-rails/lib/sentry/rails/version.rb b/sentry-rails/lib/sentry/rails/version.rb index e62a1de60..3d1dc210e 100644 --- a/sentry-rails/lib/sentry/rails/version.rb +++ b/sentry-rails/lib/sentry/rails/version.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Sentry module Rails VERSION = "5.20.1" diff --git a/sentry-rails/sentry-rails.gemspec b/sentry-rails/sentry-rails.gemspec index 67a545a36..8c47f981d 100644 --- a/sentry-rails/sentry-rails.gemspec +++ b/sentry-rails/sentry-rails.gemspec @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "lib/sentry/rails/version" Gem::Specification.new do |spec| diff --git a/sentry-rails/spec/dummy/test_rails_app/app.rb b/sentry-rails/spec/dummy/test_rails_app/app.rb index 302723863..95309fbaa 100644 --- a/sentry-rails/spec/dummy/test_rails_app/app.rb +++ b/sentry-rails/spec/dummy/test_rails_app/app.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + ENV["RAILS_ENV"] = "test" require "rails" diff --git a/sentry-rails/spec/dummy/test_rails_app/apps/5-0.rb b/sentry-rails/spec/dummy/test_rails_app/apps/5-0.rb index f1b3a2758..a68a68358 100644 --- a/sentry-rails/spec/dummy/test_rails_app/apps/5-0.rb +++ b/sentry-rails/spec/dummy/test_rails_app/apps/5-0.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + ActiveRecord::Schema.define do create_table :posts, force: true do |t| end diff --git a/sentry-rails/spec/dummy/test_rails_app/apps/5-2.rb b/sentry-rails/spec/dummy/test_rails_app/apps/5-2.rb index e7b1f2180..9dfcf0d62 100644 --- a/sentry-rails/spec/dummy/test_rails_app/apps/5-2.rb +++ b/sentry-rails/spec/dummy/test_rails_app/apps/5-2.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + ActiveRecord::Schema.define do create_table "active_storage_attachments", force: :cascade do |t| t.string "name", null: false diff --git a/sentry-rails/spec/dummy/test_rails_app/apps/6-0.rb b/sentry-rails/spec/dummy/test_rails_app/apps/6-0.rb index e7b1f2180..9dfcf0d62 100644 --- a/sentry-rails/spec/dummy/test_rails_app/apps/6-0.rb +++ b/sentry-rails/spec/dummy/test_rails_app/apps/6-0.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + ActiveRecord::Schema.define do create_table "active_storage_attachments", force: :cascade do |t| t.string "name", null: false diff --git a/sentry-rails/spec/dummy/test_rails_app/apps/6-1.rb b/sentry-rails/spec/dummy/test_rails_app/apps/6-1.rb index ac504704e..a9148a3ee 100644 --- a/sentry-rails/spec/dummy/test_rails_app/apps/6-1.rb +++ b/sentry-rails/spec/dummy/test_rails_app/apps/6-1.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + ActiveRecord::Schema.define do create_table "active_storage_attachments", force: :cascade do |t| t.string "name", null: false diff --git a/sentry-rails/spec/dummy/test_rails_app/apps/7-0.rb b/sentry-rails/spec/dummy/test_rails_app/apps/7-0.rb index ac504704e..a9148a3ee 100644 --- a/sentry-rails/spec/dummy/test_rails_app/apps/7-0.rb +++ b/sentry-rails/spec/dummy/test_rails_app/apps/7-0.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + ActiveRecord::Schema.define do create_table "active_storage_attachments", force: :cascade do |t| t.string "name", null: false diff --git a/sentry-rails/spec/dummy/test_rails_app/apps/7-1.rb b/sentry-rails/spec/dummy/test_rails_app/apps/7-1.rb index ac504704e..a9148a3ee 100644 --- a/sentry-rails/spec/dummy/test_rails_app/apps/7-1.rb +++ b/sentry-rails/spec/dummy/test_rails_app/apps/7-1.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + ActiveRecord::Schema.define do create_table "active_storage_attachments", force: :cascade do |t| t.string "name", null: false diff --git a/sentry-rails/spec/dummy/test_rails_app/configs/5-0.rb b/sentry-rails/spec/dummy/test_rails_app/configs/5-0.rb index 70cb662b3..d291ac8f8 100644 --- a/sentry-rails/spec/dummy/test_rails_app/configs/5-0.rb +++ b/sentry-rails/spec/dummy/test_rails_app/configs/5-0.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + def run_pre_initialize_cleanup; end def configure_app(app); end diff --git a/sentry-rails/spec/dummy/test_rails_app/configs/5-2.rb b/sentry-rails/spec/dummy/test_rails_app/configs/5-2.rb index f6b4f39e5..d5d88d8b6 100644 --- a/sentry-rails/spec/dummy/test_rails_app/configs/5-2.rb +++ b/sentry-rails/spec/dummy/test_rails_app/configs/5-2.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "active_storage/engine" def run_pre_initialize_cleanup; end diff --git a/sentry-rails/spec/dummy/test_rails_app/configs/6-0.rb b/sentry-rails/spec/dummy/test_rails_app/configs/6-0.rb index 7b0673b3c..bab5746a8 100644 --- a/sentry-rails/spec/dummy/test_rails_app/configs/6-0.rb +++ b/sentry-rails/spec/dummy/test_rails_app/configs/6-0.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "active_storage/engine" require "action_cable/engine" diff --git a/sentry-rails/spec/dummy/test_rails_app/configs/6-1.rb b/sentry-rails/spec/dummy/test_rails_app/configs/6-1.rb index 4532be7ca..e36c83344 100644 --- a/sentry-rails/spec/dummy/test_rails_app/configs/6-1.rb +++ b/sentry-rails/spec/dummy/test_rails_app/configs/6-1.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "active_storage/engine" require "action_cable/engine" diff --git a/sentry-rails/spec/dummy/test_rails_app/configs/7-0.rb b/sentry-rails/spec/dummy/test_rails_app/configs/7-0.rb index dd5d0716c..84652ae04 100644 --- a/sentry-rails/spec/dummy/test_rails_app/configs/7-0.rb +++ b/sentry-rails/spec/dummy/test_rails_app/configs/7-0.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "active_storage/engine" require "action_cable/engine" diff --git a/sentry-rails/spec/dummy/test_rails_app/configs/7-1.rb b/sentry-rails/spec/dummy/test_rails_app/configs/7-1.rb index d17545fe0..d0126d985 100644 --- a/sentry-rails/spec/dummy/test_rails_app/configs/7-1.rb +++ b/sentry-rails/spec/dummy/test_rails_app/configs/7-1.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "active_storage/engine" require "action_cable/engine" require "sentry/rails/error_subscriber" diff --git a/sentry-rails/spec/dummy/test_rails_app/configs/7-2.rb b/sentry-rails/spec/dummy/test_rails_app/configs/7-2.rb index d17545fe0..d0126d985 100644 --- a/sentry-rails/spec/dummy/test_rails_app/configs/7-2.rb +++ b/sentry-rails/spec/dummy/test_rails_app/configs/7-2.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "active_storage/engine" require "action_cable/engine" require "sentry/rails/error_subscriber" diff --git a/sentry-rails/spec/sentry/rails/action_cable_spec.rb b/sentry-rails/spec/sentry/rails/action_cable_spec.rb index 4b353adff..e47ad2efa 100644 --- a/sentry-rails/spec/sentry/rails/action_cable_spec.rb +++ b/sentry-rails/spec/sentry/rails/action_cable_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + if defined?(ActionCable) && ActionCable.version >= Gem::Version.new('6.0.0') require "spec_helper" require "action_cable/engine" diff --git a/sentry-rails/spec/sentry/rails/activejob_spec.rb b/sentry-rails/spec/sentry/rails/activejob_spec.rb index f5892d944..9e9e0ce36 100644 --- a/sentry-rails/spec/sentry/rails/activejob_spec.rb +++ b/sentry-rails/spec/sentry/rails/activejob_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "spec_helper" require "active_job/railtie" diff --git a/sentry-rails/spec/sentry/rails/breadcrumbs/active_support_logger_spec.rb b/sentry-rails/spec/sentry/rails/breadcrumbs/active_support_logger_spec.rb index b156eaf59..e6a0ae6e3 100644 --- a/sentry-rails/spec/sentry/rails/breadcrumbs/active_support_logger_spec.rb +++ b/sentry-rails/spec/sentry/rails/breadcrumbs/active_support_logger_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "spec_helper" RSpec.describe "Sentry::Breadcrumbs::ActiveSupportLogger", type: :request do diff --git a/sentry-rails/spec/sentry/rails/breadcrumbs/monotonic_active_support_logger_spec.rb b/sentry-rails/spec/sentry/rails/breadcrumbs/monotonic_active_support_logger_spec.rb index 0334531f6..031443c25 100644 --- a/sentry-rails/spec/sentry/rails/breadcrumbs/monotonic_active_support_logger_spec.rb +++ b/sentry-rails/spec/sentry/rails/breadcrumbs/monotonic_active_support_logger_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "spec_helper" diff --git a/sentry-rails/spec/sentry/rails/client_spec.rb b/sentry-rails/spec/sentry/rails/client_spec.rb index 81c847b9d..86ef1e110 100644 --- a/sentry-rails/spec/sentry/rails/client_spec.rb +++ b/sentry-rails/spec/sentry/rails/client_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "spec_helper" RSpec.describe Sentry::Client, type: :request, retry: 3, skip: Gem::Version.new(Rails.version) < Gem::Version.new('5.1.0') do diff --git a/sentry-rails/spec/sentry/rails/configuration_spec.rb b/sentry-rails/spec/sentry/rails/configuration_spec.rb index f27ee99a9..76a8c7546 100644 --- a/sentry-rails/spec/sentry/rails/configuration_spec.rb +++ b/sentry-rails/spec/sentry/rails/configuration_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "spec_helper" RSpec.describe Sentry::Rails::Configuration do diff --git a/sentry-rails/spec/sentry/rails/controller_methods_spec.rb b/sentry-rails/spec/sentry/rails/controller_methods_spec.rb index a751e1366..6254dc290 100644 --- a/sentry-rails/spec/sentry/rails/controller_methods_spec.rb +++ b/sentry-rails/spec/sentry/rails/controller_methods_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' require "sentry/rails/controller_methods" diff --git a/sentry-rails/spec/sentry/rails/error_subscriber_spec.rb b/sentry-rails/spec/sentry/rails/error_subscriber_spec.rb index 1bce4baca..1dcc1a0f4 100644 --- a/sentry-rails/spec/sentry/rails/error_subscriber_spec.rb +++ b/sentry-rails/spec/sentry/rails/error_subscriber_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' require 'sentry/rails/error_subscriber' diff --git a/sentry-rails/spec/sentry/rails/event_spec.rb b/sentry-rails/spec/sentry/rails/event_spec.rb index 674615f3a..6c3f7b661 100644 --- a/sentry-rails/spec/sentry/rails/event_spec.rb +++ b/sentry-rails/spec/sentry/rails/event_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' RSpec.describe Sentry::Event do diff --git a/sentry-rails/spec/sentry/rails/tracing/action_controller_subscriber_spec.rb b/sentry-rails/spec/sentry/rails/tracing/action_controller_subscriber_spec.rb index f147e1b8e..9d0a4df4e 100644 --- a/sentry-rails/spec/sentry/rails/tracing/action_controller_subscriber_spec.rb +++ b/sentry-rails/spec/sentry/rails/tracing/action_controller_subscriber_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "spec_helper" RSpec.describe Sentry::Rails::Tracing::ActionControllerSubscriber, :subscriber, type: :request do diff --git a/sentry-rails/spec/sentry/rails/tracing/action_view_subscriber_spec.rb b/sentry-rails/spec/sentry/rails/tracing/action_view_subscriber_spec.rb index aa2473312..555584024 100644 --- a/sentry-rails/spec/sentry/rails/tracing/action_view_subscriber_spec.rb +++ b/sentry-rails/spec/sentry/rails/tracing/action_view_subscriber_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "spec_helper" RSpec.describe Sentry::Rails::Tracing::ActionViewSubscriber, :subscriber, type: :request do diff --git a/sentry-rails/spec/sentry/rails/tracing/active_record_subscriber_spec.rb b/sentry-rails/spec/sentry/rails/tracing/active_record_subscriber_spec.rb index aa29b82d2..2441a63d3 100644 --- a/sentry-rails/spec/sentry/rails/tracing/active_record_subscriber_spec.rb +++ b/sentry-rails/spec/sentry/rails/tracing/active_record_subscriber_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "spec_helper" RSpec.describe Sentry::Rails::Tracing::ActiveRecordSubscriber, :subscriber do diff --git a/sentry-rails/spec/sentry/rails/tracing/active_storage_subscriber_spec.rb b/sentry-rails/spec/sentry/rails/tracing/active_storage_subscriber_spec.rb index 5d34db1e3..a5e186d7e 100644 --- a/sentry-rails/spec/sentry/rails/tracing/active_storage_subscriber_spec.rb +++ b/sentry-rails/spec/sentry/rails/tracing/active_storage_subscriber_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "spec_helper" RSpec.describe Sentry::Rails::Tracing::ActiveStorageSubscriber, :subscriber, type: :request, skip: Rails.version.to_f <= 5.2 do diff --git a/sentry-rails/spec/sentry/rails/tracing_spec.rb b/sentry-rails/spec/sentry/rails/tracing_spec.rb index 287bd8acc..927e11c8e 100644 --- a/sentry-rails/spec/sentry/rails/tracing_spec.rb +++ b/sentry-rails/spec/sentry/rails/tracing_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "spec_helper" RSpec.describe Sentry::Rails::Tracing, type: :request do diff --git a/sentry-rails/spec/sentry/rails_spec.rb b/sentry-rails/spec/sentry/rails_spec.rb index 88c1dae1f..dd069db81 100644 --- a/sentry-rails/spec/sentry/rails_spec.rb +++ b/sentry-rails/spec/sentry/rails_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "spec_helper" RSpec.describe Sentry::Rails, type: :request do diff --git a/sentry-rails/spec/sentry/send_event_job_spec.rb b/sentry-rails/spec/sentry/send_event_job_spec.rb index c50130f65..00f89b2ed 100644 --- a/sentry-rails/spec/sentry/send_event_job_spec.rb +++ b/sentry-rails/spec/sentry/send_event_job_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "active_job" require "spec_helper" diff --git a/sentry-rails/spec/spec_helper.rb b/sentry-rails/spec/spec_helper.rb index 55d3334d3..68b7d5a04 100644 --- a/sentry-rails/spec/spec_helper.rb +++ b/sentry-rails/spec/spec_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "bundler/setup" begin require "debug/prelude" diff --git a/sentry-resque/Gemfile b/sentry-resque/Gemfile index 58c13cada..96f47a3a5 100644 --- a/sentry-resque/Gemfile +++ b/sentry-resque/Gemfile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + source "https://rubygems.org" git_source(:github) { |name| "https://github.com/#{name}.git" } diff --git a/sentry-resque/Gemfile_with_rails.rb b/sentry-resque/Gemfile_with_rails.rb index bceb75350..306b36624 100644 --- a/sentry-resque/Gemfile_with_rails.rb +++ b/sentry-resque/Gemfile_with_rails.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + eval_gemfile File.expand_path("Gemfile", __dir__) gem "sentry-rails", path: "../sentry-rails" diff --git a/sentry-resque/Rakefile b/sentry-resque/Rakefile index 7b2756854..13afab191 100644 --- a/sentry-resque/Rakefile +++ b/sentry-resque/Rakefile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "bundler/gem_tasks" require "rspec/core/rake_task" diff --git a/sentry-resque/bin/console b/sentry-resque/bin/console index 660c7a889..f0f5a7b6a 100755 --- a/sentry-resque/bin/console +++ b/sentry-resque/bin/console @@ -1,4 +1,5 @@ #!/usr/bin/env ruby +# frozen_string_literal: true require "bundler/setup" require "sentry/ruby" diff --git a/sentry-resque/example/Gemfile b/sentry-resque/example/Gemfile index b9432d218..20d98ac4a 100644 --- a/sentry-resque/example/Gemfile +++ b/sentry-resque/example/Gemfile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + source "https://rubygems.org" gem "rails" diff --git a/sentry-resque/example/app.rb b/sentry-resque/example/app.rb index 843e8c028..2e85eca19 100644 --- a/sentry-resque/example/app.rb +++ b/sentry-resque/example/app.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "active_job" require "resque" require "sentry-resque" diff --git a/sentry-resque/lib/sentry-resque.rb b/sentry-resque/lib/sentry-resque.rb index 10af757c0..1d499af8a 100644 --- a/sentry-resque/lib/sentry-resque.rb +++ b/sentry-resque/lib/sentry-resque.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "resque" require "sentry-ruby" require "sentry/integrable" diff --git a/sentry-resque/lib/sentry/resque/configuration.rb b/sentry-resque/lib/sentry/resque/configuration.rb index f0d7ffae8..126d6f7eb 100644 --- a/sentry-resque/lib/sentry/resque/configuration.rb +++ b/sentry-resque/lib/sentry/resque/configuration.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Sentry class Configuration attr_reader :resque diff --git a/sentry-resque/lib/sentry/resque/version.rb b/sentry-resque/lib/sentry/resque/version.rb index 3bac872bc..8ecd6cfe4 100644 --- a/sentry-resque/lib/sentry/resque/version.rb +++ b/sentry-resque/lib/sentry/resque/version.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Sentry module Resque VERSION = "5.20.1" diff --git a/sentry-resque/sentry-resque.gemspec b/sentry-resque/sentry-resque.gemspec index 6d198dcab..4ce4a7ea8 100644 --- a/sentry-resque/sentry-resque.gemspec +++ b/sentry-resque/sentry-resque.gemspec @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "lib/sentry/resque/version" Gem::Specification.new do |spec| diff --git a/sentry-resque/spec/sentry/resque/configuration_spec.rb b/sentry-resque/spec/sentry/resque/configuration_spec.rb index abde7c4d4..af2f464d9 100644 --- a/sentry-resque/spec/sentry/resque/configuration_spec.rb +++ b/sentry-resque/spec/sentry/resque/configuration_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "spec_helper" RSpec.describe Sentry::Resque::Configuration do diff --git a/sentry-resque/spec/sentry/resque_spec.rb b/sentry-resque/spec/sentry/resque_spec.rb index 2a4739b6f..7239284e3 100644 --- a/sentry-resque/spec/sentry/resque_spec.rb +++ b/sentry-resque/spec/sentry/resque_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "spec_helper" def process_job(worker) diff --git a/sentry-resque/spec/sentry/tracing_spec.rb b/sentry-resque/spec/sentry/tracing_spec.rb index e77b84f4e..bf81f9006 100644 --- a/sentry-resque/spec/sentry/tracing_spec.rb +++ b/sentry-resque/spec/sentry/tracing_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "spec_helper" RSpec.describe Sentry::Resque do diff --git a/sentry-resque/spec/spec_helper.rb b/sentry-resque/spec/spec_helper.rb index dd212aab3..73b3baefe 100644 --- a/sentry-resque/spec/spec_helper.rb +++ b/sentry-resque/spec/spec_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "bundler/setup" begin require "debug/prelude" diff --git a/sentry-ruby/.rubocop.yml b/sentry-ruby/.rubocop.yml new file mode 120000 index 000000000..7cc18e076 --- /dev/null +++ b/sentry-ruby/.rubocop.yml @@ -0,0 +1 @@ +../.rubocop.yml \ No newline at end of file diff --git a/sentry-ruby/Gemfile b/sentry-ruby/Gemfile index f13a6fe48..5ca0f99c2 100644 --- a/sentry-ruby/Gemfile +++ b/sentry-ruby/Gemfile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + source "https://rubygems.org" git_source(:github) { |name| "https://github.com/#{name}.git" } diff --git a/sentry-ruby/Rakefile b/sentry-ruby/Rakefile index c199ef8f8..fb7a8c183 100644 --- a/sentry-ruby/Rakefile +++ b/sentry-ruby/Rakefile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "rake/clean" CLOBBER.include "pkg" diff --git a/sentry-ruby/benchmarks/allocation_comparison.rb b/sentry-ruby/benchmarks/allocation_comparison.rb index 90c7b2b19..c765b2ff6 100644 --- a/sentry-ruby/benchmarks/allocation_comparison.rb +++ b/sentry-ruby/benchmarks/allocation_comparison.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'benchmark/memory' require "sentry-ruby" require "sentry/benchmarks/benchmark_transport" diff --git a/sentry-ruby/benchmarks/allocation_report.rb b/sentry-ruby/benchmarks/allocation_report.rb index 3e0359d72..54fbd4139 100644 --- a/sentry-ruby/benchmarks/allocation_report.rb +++ b/sentry-ruby/benchmarks/allocation_report.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'benchmark/ipsa' require "sentry-ruby" require "sentry/benchmarks/benchmark_transport" diff --git a/sentry-ruby/benchmarks/exception_locals_capturing.rb b/sentry-ruby/benchmarks/exception_locals_capturing.rb index 00c05f9e9..6ebc46ee9 100644 --- a/sentry-ruby/benchmarks/exception_locals_capturing.rb +++ b/sentry-ruby/benchmarks/exception_locals_capturing.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'benchmark/ips' def raise_n_exceptions(n, with_sleep: false) diff --git a/sentry-ruby/bin/console b/sentry-ruby/bin/console index 57a532604..6ab9e0413 100755 --- a/sentry-ruby/bin/console +++ b/sentry-ruby/bin/console @@ -1,4 +1,5 @@ #!/usr/bin/env ruby +# frozen_string_literal: true require "bundler/setup" require "debug" diff --git a/sentry-ruby/lib/sentry-ruby.rb b/sentry-ruby/lib/sentry-ruby.rb index db3420aba..6dcf99671 100644 --- a/sentry-ruby/lib/sentry-ruby.rb +++ b/sentry-ruby/lib/sentry-ruby.rb @@ -42,11 +42,11 @@ module Sentry CAPTURED_SIGNATURE = :@__sentry_captured - LOGGER_PROGNAME = "sentry".freeze + LOGGER_PROGNAME = "sentry" - SENTRY_TRACE_HEADER_NAME = "sentry-trace".freeze + SENTRY_TRACE_HEADER_NAME = "sentry-trace" - BAGGAGE_HEADER_NAME = "baggage".freeze + BAGGAGE_HEADER_NAME = "baggage" THREAD_LOCAL = :sentry_hub diff --git a/sentry-ruby/lib/sentry/backtrace.rb b/sentry-ruby/lib/sentry/backtrace.rb index c5ab16d39..5fd2aadff 100644 --- a/sentry-ruby/lib/sentry/backtrace.rb +++ b/sentry-ruby/lib/sentry/backtrace.rb @@ -13,10 +13,10 @@ class Line ^ \s* (?: [a-zA-Z]: | uri:classloader: )? ([^:]+ | <.*>): (\d+) (?: :in\s('|`)([^']+)')?$ - /x.freeze + /x # org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:170) - JAVA_INPUT_FORMAT = /^(.+)\.([^\.]+)\(([^\:]+)\:(\d+)\)$/.freeze + JAVA_INPUT_FORMAT = /^(.+)\.([^\.]+)\(([^\:]+)\:(\d+)\)$/ # The file portion of the line (such as app/models/user.rb) attr_reader :file diff --git a/sentry-ruby/lib/sentry/baggage.rb b/sentry-ruby/lib/sentry/baggage.rb index 2b375a846..dc02dd8e6 100644 --- a/sentry-ruby/lib/sentry/baggage.rb +++ b/sentry-ruby/lib/sentry/baggage.rb @@ -6,7 +6,7 @@ module Sentry # A {https://www.w3.org/TR/baggage W3C Baggage Header} implementation. class Baggage SENTRY_PREFIX = "sentry-" - SENTRY_PREFIX_REGEX = /^sentry-/.freeze + SENTRY_PREFIX_REGEX = /^sentry-/ # @return [Hash] attr_reader :items diff --git a/sentry-ruby/lib/sentry/configuration.rb b/sentry-ruby/lib/sentry/configuration.rb index 505e46a2a..b13c81c49 100644 --- a/sentry-ruby/lib/sentry/configuration.rb +++ b/sentry-ruby/lib/sentry/configuration.rb @@ -335,19 +335,19 @@ def capture_exception_frame_locals=(value) ].freeze HEROKU_DYNO_METADATA_MESSAGE = "You are running on Heroku but haven't enabled Dyno Metadata. For Sentry's "\ - "release detection to work correctly, please run `heroku labs:enable runtime-dyno-metadata`".freeze + "release detection to work correctly, please run `heroku labs:enable runtime-dyno-metadata`" - LOG_PREFIX = "** [Sentry] ".freeze - MODULE_SEPARATOR = "::".freeze + LOG_PREFIX = "** [Sentry] " + MODULE_SEPARATOR = "::" SKIP_INSPECTION_ATTRIBUTES = [:@linecache, :@stacktrace_builder] INSTRUMENTERS = [:sentry, :otel] - PROPAGATION_TARGETS_MATCH_ALL = /.*/.freeze + PROPAGATION_TARGETS_MATCH_ALL = /.*/ DEFAULT_PATCHES = %i[redis puma http].freeze - APP_DIRS_PATTERN = /(bin|exe|app|config|lib|test|spec)/.freeze + APP_DIRS_PATTERN = /(bin|exe|app|config|lib|test|spec)/ class << self # Post initialization callbacks are called at the end of initialization process diff --git a/sentry-ruby/lib/sentry/cron/monitor_check_ins.rb b/sentry-ruby/lib/sentry/cron/monitor_check_ins.rb index ac7e35d81..835ae84ad 100644 --- a/sentry-ruby/lib/sentry/cron/monitor_check_ins.rb +++ b/sentry-ruby/lib/sentry/cron/monitor_check_ins.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Sentry module Cron module MonitorCheckIns diff --git a/sentry-ruby/lib/sentry/interfaces/single_exception.rb b/sentry-ruby/lib/sentry/interfaces/single_exception.rb index f7126e702..db2d54e7b 100644 --- a/sentry-ruby/lib/sentry/interfaces/single_exception.rb +++ b/sentry-ruby/lib/sentry/interfaces/single_exception.rb @@ -7,8 +7,8 @@ class SingleExceptionInterface < Interface include CustomInspection SKIP_INSPECTION_ATTRIBUTES = [:@stacktrace] - PROBLEMATIC_LOCAL_VALUE_REPLACEMENT = "[ignored due to error]".freeze - OMISSION_MARK = "...".freeze + PROBLEMATIC_LOCAL_VALUE_REPLACEMENT = "[ignored due to error]" + OMISSION_MARK = "..." MAX_LOCAL_BYTES = 1024 attr_reader :type, :module, :thread_id, :stacktrace, :mechanism diff --git a/sentry-ruby/lib/sentry/rack/capture_exceptions.rb b/sentry-ruby/lib/sentry/rack/capture_exceptions.rb index 5bb8eda67..40cdfb4f8 100644 --- a/sentry-ruby/lib/sentry/rack/capture_exceptions.rb +++ b/sentry-ruby/lib/sentry/rack/capture_exceptions.rb @@ -54,7 +54,7 @@ def collect_exception(env) end def transaction_op - "http.server".freeze + "http.server" end def capture_exception(exception, env) diff --git a/sentry-ruby/lib/sentry/test_helper.rb b/sentry-ruby/lib/sentry/test_helper.rb index 212c35db5..d36dc0be0 100644 --- a/sentry-ruby/lib/sentry/test_helper.rb +++ b/sentry-ruby/lib/sentry/test_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Sentry module TestHelper DUMMY_DSN = "http://12345:67890@sentry.localdomain/sentry/42" diff --git a/sentry-ruby/lib/sentry/transaction.rb b/sentry-ruby/lib/sentry/transaction.rb index ad9447061..5e3ceb982 100644 --- a/sentry-ruby/lib/sentry/transaction.rb +++ b/sentry-ruby/lib/sentry/transaction.rb @@ -9,7 +9,7 @@ class Transaction < Span # @deprecated Use Sentry::PropagationContext::SENTRY_TRACE_REGEXP instead. SENTRY_TRACE_REGEXP = PropagationContext::SENTRY_TRACE_REGEXP - UNLABELD_NAME = "".freeze + UNLABELD_NAME = "" MESSAGE_PREFIX = "[Tracing]" # https://develop.sentry.dev/sdk/event-payloads/transaction/#transaction-annotations diff --git a/sentry-ruby/sentry-ruby-core.gemspec b/sentry-ruby/sentry-ruby-core.gemspec index a676fe126..4bd423750 100644 --- a/sentry-ruby/sentry-ruby-core.gemspec +++ b/sentry-ruby/sentry-ruby-core.gemspec @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "lib/sentry/version" Gem::Specification.new do |spec| diff --git a/sentry-ruby/sentry-ruby.gemspec b/sentry-ruby/sentry-ruby.gemspec index 44fcfceaa..ba183705c 100644 --- a/sentry-ruby/sentry-ruby.gemspec +++ b/sentry-ruby/sentry-ruby.gemspec @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "lib/sentry/version" Gem::Specification.new do |spec| diff --git a/sentry-ruby/spec/contexts/with_request_mock.rb b/sentry-ruby/spec/contexts/with_request_mock.rb index bc103f7dc..e6c480256 100644 --- a/sentry-ruby/spec/contexts/with_request_mock.rb +++ b/sentry-ruby/spec/contexts/with_request_mock.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # because our patch on Net::HTTP is relatively low-level, we need to stub methods on socket level # which is not supported by most of the http mocking library # so we need to put something together ourselves diff --git a/sentry-ruby/spec/initialization_check_spec.rb b/sentry-ruby/spec/initialization_check_spec.rb index 039384c1d..129d5fdff 100644 --- a/sentry-ruby/spec/initialization_check_spec.rb +++ b/sentry-ruby/spec/initialization_check_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "spec_helper" RSpec.describe "with uninitialized SDK" do diff --git a/sentry-ruby/spec/isolated/puma_spec.rb b/sentry-ruby/spec/isolated/puma_spec.rb index 0e2082519..6f416d6e9 100644 --- a/sentry-ruby/spec/isolated/puma_spec.rb +++ b/sentry-ruby/spec/isolated/puma_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "puma" require_relative "../spec_helper" diff --git a/sentry-ruby/spec/sentry/background_worker_spec.rb b/sentry-ruby/spec/sentry/background_worker_spec.rb index e1b900094..9e15b43ec 100644 --- a/sentry-ruby/spec/sentry/background_worker_spec.rb +++ b/sentry-ruby/spec/sentry/background_worker_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "spec_helper" RSpec.describe Sentry::BackgroundWorker do diff --git a/sentry-ruby/spec/sentry/backpressure_monitor_spec.rb b/sentry-ruby/spec/sentry/backpressure_monitor_spec.rb index 1419cffdb..e0147d87c 100644 --- a/sentry-ruby/spec/sentry/backpressure_monitor_spec.rb +++ b/sentry-ruby/spec/sentry/backpressure_monitor_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' RSpec.describe Sentry::BackpressureMonitor do diff --git a/sentry-ruby/spec/sentry/backtrace/lines_spec.rb b/sentry-ruby/spec/sentry/backtrace/lines_spec.rb index 92dc48e6d..8a49ea1d8 100644 --- a/sentry-ruby/spec/sentry/backtrace/lines_spec.rb +++ b/sentry-ruby/spec/sentry/backtrace/lines_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "spec_helper" RSpec.describe Sentry::Backtrace::Line do diff --git a/sentry-ruby/spec/sentry/backtrace_spec.rb b/sentry-ruby/spec/sentry/backtrace_spec.rb index b373c45f4..648e4ee8e 100644 --- a/sentry-ruby/spec/sentry/backtrace_spec.rb +++ b/sentry-ruby/spec/sentry/backtrace_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' RSpec.describe Sentry::Backtrace do diff --git a/sentry-ruby/spec/sentry/baggage_spec.rb b/sentry-ruby/spec/sentry/baggage_spec.rb index 3d72a5687..a9cc44873 100644 --- a/sentry-ruby/spec/sentry/baggage_spec.rb +++ b/sentry-ruby/spec/sentry/baggage_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "spec_helper" RSpec.describe Sentry::Baggage do diff --git a/sentry-ruby/spec/sentry/breadcrumb/http_logger_spec.rb b/sentry-ruby/spec/sentry/breadcrumb/http_logger_spec.rb index 66146ef64..a4fab84ed 100644 --- a/sentry-ruby/spec/sentry/breadcrumb/http_logger_spec.rb +++ b/sentry-ruby/spec/sentry/breadcrumb/http_logger_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "spec_helper" require 'contexts/with_request_mock' diff --git a/sentry-ruby/spec/sentry/breadcrumb/redis_logger_spec.rb b/sentry-ruby/spec/sentry/breadcrumb/redis_logger_spec.rb index 4d0d541df..4285a43f4 100644 --- a/sentry-ruby/spec/sentry/breadcrumb/redis_logger_spec.rb +++ b/sentry-ruby/spec/sentry/breadcrumb/redis_logger_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "spec_helper" RSpec.describe :redis_logger do diff --git a/sentry-ruby/spec/sentry/breadcrumb/sentry_logger_spec.rb b/sentry-ruby/spec/sentry/breadcrumb/sentry_logger_spec.rb index aafcf6f96..da3cd97c7 100644 --- a/sentry-ruby/spec/sentry/breadcrumb/sentry_logger_spec.rb +++ b/sentry-ruby/spec/sentry/breadcrumb/sentry_logger_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "spec_helper" RSpec.describe "Sentry::Breadcrumbs::SentryLogger" do diff --git a/sentry-ruby/spec/sentry/breadcrumb_buffer_spec.rb b/sentry-ruby/spec/sentry/breadcrumb_buffer_spec.rb index 04a76fe3c..f68e223b3 100644 --- a/sentry-ruby/spec/sentry/breadcrumb_buffer_spec.rb +++ b/sentry-ruby/spec/sentry/breadcrumb_buffer_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "spec_helper" RSpec.describe Sentry::BreadcrumbBuffer do diff --git a/sentry-ruby/spec/sentry/breadcrumb_spec.rb b/sentry-ruby/spec/sentry/breadcrumb_spec.rb index 66c2d1112..2eddb7101 100644 --- a/sentry-ruby/spec/sentry/breadcrumb_spec.rb +++ b/sentry-ruby/spec/sentry/breadcrumb_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "spec_helper" RSpec.describe Sentry::Breadcrumb do diff --git a/sentry-ruby/spec/sentry/client/event_sending_spec.rb b/sentry-ruby/spec/sentry/client/event_sending_spec.rb index b1b1a041c..86b4b6c67 100644 --- a/sentry-ruby/spec/sentry/client/event_sending_spec.rb +++ b/sentry-ruby/spec/sentry/client/event_sending_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' RSpec.describe Sentry::Client do diff --git a/sentry-ruby/spec/sentry/client_spec.rb b/sentry-ruby/spec/sentry/client_spec.rb index bd1debcf2..e069ccc5b 100644 --- a/sentry-ruby/spec/sentry/client_spec.rb +++ b/sentry-ruby/spec/sentry/client_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' class ExceptionWithContext < StandardError @@ -341,7 +343,12 @@ def detailed_message(*) event = subject.event_from_exception(NonStringMessageError.new) hash = event.to_hash expect(event).to be_a(Sentry::ErrorEvent) - expect(hash[:exception][:values][0][:value]).to eq("{:foo=>\"bar\"}") + + if RUBY_VERSION >= "3.4" + expect(hash[:exception][:values][0][:value]).to eq("{foo: \"bar\"}") + else + expect(hash[:exception][:values][0][:value]).to eq("{:foo=>\"bar\"}") + end end end diff --git a/sentry-ruby/spec/sentry/configuration_spec.rb b/sentry-ruby/spec/sentry/configuration_spec.rb index f910712ad..afd78625b 100644 --- a/sentry-ruby/spec/sentry/configuration_spec.rb +++ b/sentry-ruby/spec/sentry/configuration_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' RSpec.describe Sentry::Configuration do diff --git a/sentry-ruby/spec/sentry/cron/monitor_check_ins_spec.rb b/sentry-ruby/spec/sentry/cron/monitor_check_ins_spec.rb index fb8212df6..48cd3e044 100644 --- a/sentry-ruby/spec/sentry/cron/monitor_check_ins_spec.rb +++ b/sentry-ruby/spec/sentry/cron/monitor_check_ins_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' RSpec.describe Sentry::Cron::MonitorCheckIns do diff --git a/sentry-ruby/spec/sentry/cron/monitor_config_spec.rb b/sentry-ruby/spec/sentry/cron/monitor_config_spec.rb index 68bbbe95a..1c934e8cc 100644 --- a/sentry-ruby/spec/sentry/cron/monitor_config_spec.rb +++ b/sentry-ruby/spec/sentry/cron/monitor_config_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' RSpec.describe Sentry::Cron::MonitorConfig do diff --git a/sentry-ruby/spec/sentry/cron/monitor_schedule_spec.rb b/sentry-ruby/spec/sentry/cron/monitor_schedule_spec.rb index 8e1b422d1..909a9b4fa 100644 --- a/sentry-ruby/spec/sentry/cron/monitor_schedule_spec.rb +++ b/sentry-ruby/spec/sentry/cron/monitor_schedule_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' RSpec.describe Sentry::Cron::MonitorSchedule::Crontab do diff --git a/sentry-ruby/spec/sentry/dsn_spec.rb b/sentry-ruby/spec/sentry/dsn_spec.rb index 24256f291..0a0eaecb4 100644 --- a/sentry-ruby/spec/sentry/dsn_spec.rb +++ b/sentry-ruby/spec/sentry/dsn_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "spec_helper" RSpec.describe Sentry::DSN do diff --git a/sentry-ruby/spec/sentry/envelope/item_spec.rb b/sentry-ruby/spec/sentry/envelope/item_spec.rb index 8936c7707..ea9cf1019 100644 --- a/sentry-ruby/spec/sentry/envelope/item_spec.rb +++ b/sentry-ruby/spec/sentry/envelope/item_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "spec_helper" RSpec.describe Sentry::Envelope::Item do diff --git a/sentry-ruby/spec/sentry/event_spec.rb b/sentry-ruby/spec/sentry/event_spec.rb index ea59f95e1..90acb4da8 100644 --- a/sentry-ruby/spec/sentry/event_spec.rb +++ b/sentry-ruby/spec/sentry/event_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' RSpec.describe Sentry::Event do diff --git a/sentry-ruby/spec/sentry/faraday_spec.rb b/sentry-ruby/spec/sentry/faraday_spec.rb index f4632032f..0cb69fe39 100644 --- a/sentry-ruby/spec/sentry/faraday_spec.rb +++ b/sentry-ruby/spec/sentry/faraday_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "faraday" require_relative "../spec_helper" diff --git a/sentry-ruby/spec/sentry/graphql_spec.rb b/sentry-ruby/spec/sentry/graphql_spec.rb index 5820b73d2..a90dfe6b0 100644 --- a/sentry-ruby/spec/sentry/graphql_spec.rb +++ b/sentry-ruby/spec/sentry/graphql_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' with_graphql = begin diff --git a/sentry-ruby/spec/sentry/hub_spec.rb b/sentry-ruby/spec/sentry/hub_spec.rb index c7ada3ae6..735bc6acd 100644 --- a/sentry-ruby/spec/sentry/hub_spec.rb +++ b/sentry-ruby/spec/sentry/hub_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' RSpec.describe Sentry::Hub do diff --git a/sentry-ruby/spec/sentry/integrable_spec.rb b/sentry-ruby/spec/sentry/integrable_spec.rb index 269ba821e..6e7a03a07 100644 --- a/sentry-ruby/spec/sentry/integrable_spec.rb +++ b/sentry-ruby/spec/sentry/integrable_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "spec_helper" require "sentry/integrable" diff --git a/sentry-ruby/spec/sentry/interface_spec.rb b/sentry-ruby/spec/sentry/interface_spec.rb index 7d95d5263..2d70cdc9b 100644 --- a/sentry-ruby/spec/sentry/interface_spec.rb +++ b/sentry-ruby/spec/sentry/interface_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' require 'sentry/interface' diff --git a/sentry-ruby/spec/sentry/interfaces/request_interface_spec.rb b/sentry-ruby/spec/sentry/interfaces/request_interface_spec.rb index 580a610d3..a7a2225d0 100644 --- a/sentry-ruby/spec/sentry/interfaces/request_interface_spec.rb +++ b/sentry-ruby/spec/sentry/interfaces/request_interface_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' return unless defined?(Rack) diff --git a/sentry-ruby/spec/sentry/interfaces/stacktrace_builder_spec.rb b/sentry-ruby/spec/sentry/interfaces/stacktrace_builder_spec.rb index e7c05d6ad..fd89360a9 100644 --- a/sentry-ruby/spec/sentry/interfaces/stacktrace_builder_spec.rb +++ b/sentry-ruby/spec/sentry/interfaces/stacktrace_builder_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' RSpec.describe Sentry::StacktraceBuilder do @@ -11,8 +13,8 @@ let(:backtrace) do [ - "#{fixture_file}:6:in `bar'", - "#{fixture_file}:2:in `foo'" + "#{fixture_file}:8:in `bar'", + "#{fixture_file}:4:in `foo'" ] end @@ -36,8 +38,8 @@ expect(first_frame.filename).to match(/stacktrace_test_fixture.rb/) expect(first_frame.function).to eq("foo") - expect(first_frame.lineno).to eq(2) - expect(first_frame.pre_context).to eq([nil, nil, "def foo\n"]) + expect(first_frame.lineno).to eq(4) + expect(first_frame.pre_context).to eq(["# frozen_string_literal: true\n", "\n", "def foo\n"]) expect(first_frame.context_line).to eq(" bar\n") expect(first_frame.post_context).to eq(["end\n", "\n", "def bar\n"]) @@ -45,7 +47,7 @@ expect(second_frame.filename).to match(/stacktrace_test_fixture.rb/) expect(second_frame.function).to eq("bar") - expect(second_frame.lineno).to eq(6) + expect(second_frame.lineno).to eq(8) expect(second_frame.pre_context).to eq(["end\n", "\n", "def bar\n"]) expect(second_frame.context_line).to eq(" baz\n") expect(second_frame.post_context).to eq(["end\n", nil, nil]) @@ -92,7 +94,7 @@ expect(second_frame.filename).to match(/stacktrace_test_fixture.rb/) expect(second_frame.function).to eq("bar") - expect(second_frame.lineno).to eq(6) + expect(second_frame.lineno).to eq(8) expect(second_frame.vars).to eq({ foo: "bar" }) end end @@ -104,7 +106,7 @@ expect(hash[:filename]).to match(/stacktrace_test_fixture.rb/) expect(hash[:function]).to eq("bar") - expect(hash[:lineno]).to eq(6) + expect(hash[:lineno]).to eq(8) expect(hash[:pre_context]).to eq(["end\n", "\n", "def bar\n"]) expect(hash[:context_line]).to eq(" baz\n") expect(hash[:post_context]).to eq(["end\n", nil, nil]) diff --git a/sentry-ruby/spec/sentry/interfaces/stacktrace_spec.rb b/sentry-ruby/spec/sentry/interfaces/stacktrace_spec.rb index 3236af606..6ceb0b1d0 100644 --- a/sentry-ruby/spec/sentry/interfaces/stacktrace_spec.rb +++ b/sentry-ruby/spec/sentry/interfaces/stacktrace_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' RSpec.describe Sentry::StacktraceInterface::Frame do diff --git a/sentry-ruby/spec/sentry/linecache_spec.rb b/sentry-ruby/spec/sentry/linecache_spec.rb index 56c9e086b..097b3ed56 100644 --- a/sentry-ruby/spec/sentry/linecache_spec.rb +++ b/sentry-ruby/spec/sentry/linecache_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' # rubocop:disable Style/WordArray RSpec.describe Sentry::LineCache do diff --git a/sentry-ruby/spec/sentry/metrics/aggregator_spec.rb b/sentry-ruby/spec/sentry/metrics/aggregator_spec.rb index dcd78ab86..b54c6a0d9 100644 --- a/sentry-ruby/spec/sentry/metrics/aggregator_spec.rb +++ b/sentry-ruby/spec/sentry/metrics/aggregator_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' RSpec.describe Sentry::Metrics::Aggregator do diff --git a/sentry-ruby/spec/sentry/metrics/configuration_spec.rb b/sentry-ruby/spec/sentry/metrics/configuration_spec.rb index 2c7e22fbe..3d04ad3ea 100644 --- a/sentry-ruby/spec/sentry/metrics/configuration_spec.rb +++ b/sentry-ruby/spec/sentry/metrics/configuration_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' RSpec.describe Sentry::Metrics::Configuration do diff --git a/sentry-ruby/spec/sentry/metrics/counter_metric_spec.rb b/sentry-ruby/spec/sentry/metrics/counter_metric_spec.rb index f92a0135f..f1c480b45 100644 --- a/sentry-ruby/spec/sentry/metrics/counter_metric_spec.rb +++ b/sentry-ruby/spec/sentry/metrics/counter_metric_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' RSpec.describe Sentry::Metrics::CounterMetric do diff --git a/sentry-ruby/spec/sentry/metrics/distribution_metric_spec.rb b/sentry-ruby/spec/sentry/metrics/distribution_metric_spec.rb index 7e5b2f2d4..e8ac709f3 100644 --- a/sentry-ruby/spec/sentry/metrics/distribution_metric_spec.rb +++ b/sentry-ruby/spec/sentry/metrics/distribution_metric_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' RSpec.describe Sentry::Metrics::DistributionMetric do diff --git a/sentry-ruby/spec/sentry/metrics/gauge_metric_spec.rb b/sentry-ruby/spec/sentry/metrics/gauge_metric_spec.rb index 44be08465..fce3141c6 100644 --- a/sentry-ruby/spec/sentry/metrics/gauge_metric_spec.rb +++ b/sentry-ruby/spec/sentry/metrics/gauge_metric_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' RSpec.describe Sentry::Metrics::GaugeMetric do diff --git a/sentry-ruby/spec/sentry/metrics/local_aggregator_spec.rb b/sentry-ruby/spec/sentry/metrics/local_aggregator_spec.rb index 5c5ab0583..3056808da 100644 --- a/sentry-ruby/spec/sentry/metrics/local_aggregator_spec.rb +++ b/sentry-ruby/spec/sentry/metrics/local_aggregator_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' RSpec.describe Sentry::Metrics::LocalAggregator do diff --git a/sentry-ruby/spec/sentry/metrics/metric_spec.rb b/sentry-ruby/spec/sentry/metrics/metric_spec.rb index a5ed3fd93..ccb4fa222 100644 --- a/sentry-ruby/spec/sentry/metrics/metric_spec.rb +++ b/sentry-ruby/spec/sentry/metrics/metric_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' RSpec.describe Sentry::Metrics::Metric do diff --git a/sentry-ruby/spec/sentry/metrics/set_metric_spec.rb b/sentry-ruby/spec/sentry/metrics/set_metric_spec.rb index fdf74dd0d..2cd01da83 100644 --- a/sentry-ruby/spec/sentry/metrics/set_metric_spec.rb +++ b/sentry-ruby/spec/sentry/metrics/set_metric_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' RSpec.describe Sentry::Metrics::SetMetric do diff --git a/sentry-ruby/spec/sentry/metrics/timing_spec.rb b/sentry-ruby/spec/sentry/metrics/timing_spec.rb index 8142fbb4d..3b2ee2235 100644 --- a/sentry-ruby/spec/sentry/metrics/timing_spec.rb +++ b/sentry-ruby/spec/sentry/metrics/timing_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' RSpec.describe Sentry::Metrics::Timing do diff --git a/sentry-ruby/spec/sentry/metrics_spec.rb b/sentry-ruby/spec/sentry/metrics_spec.rb index 335c31e5a..e50c55074 100644 --- a/sentry-ruby/spec/sentry/metrics_spec.rb +++ b/sentry-ruby/spec/sentry/metrics_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' RSpec.describe Sentry::Metrics do diff --git a/sentry-ruby/spec/sentry/net/http_spec.rb b/sentry-ruby/spec/sentry/net/http_spec.rb index 6a6dbbf73..9de0a6f76 100644 --- a/sentry-ruby/spec/sentry/net/http_spec.rb +++ b/sentry-ruby/spec/sentry/net/http_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "spec_helper" require 'contexts/with_request_mock' diff --git a/sentry-ruby/spec/sentry/profiler_spec.rb b/sentry-ruby/spec/sentry/profiler_spec.rb index 9100a3441..883fac025 100644 --- a/sentry-ruby/spec/sentry/profiler_spec.rb +++ b/sentry-ruby/spec/sentry/profiler_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "spec_helper" RSpec.describe Sentry::Profiler, when: :stack_prof_installed? do diff --git a/sentry-ruby/spec/sentry/propagation_context_spec.rb b/sentry-ruby/spec/sentry/propagation_context_spec.rb index 644fc9530..7e16404b6 100644 --- a/sentry-ruby/spec/sentry/propagation_context_spec.rb +++ b/sentry-ruby/spec/sentry/propagation_context_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "spec_helper" RSpec.describe Sentry::PropagationContext do diff --git a/sentry-ruby/spec/sentry/rack/capture_exceptions_spec.rb b/sentry-ruby/spec/sentry/rack/capture_exceptions_spec.rb index 83095d842..21e1786ef 100644 --- a/sentry-ruby/spec/sentry/rack/capture_exceptions_spec.rb +++ b/sentry-ruby/spec/sentry/rack/capture_exceptions_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' require 'sentry/vernier/profiler' diff --git a/sentry-ruby/spec/sentry/rake_spec.rb b/sentry-ruby/spec/sentry/rake_spec.rb index a1eb22998..904f19170 100644 --- a/sentry-ruby/spec/sentry/rake_spec.rb +++ b/sentry-ruby/spec/sentry/rake_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "spec_helper" RSpec.describe "rake auto-reporting" do diff --git a/sentry-ruby/spec/sentry/redis_spec.rb b/sentry-ruby/spec/sentry/redis_spec.rb index 2722e0498..50e86ac55 100644 --- a/sentry-ruby/spec/sentry/redis_spec.rb +++ b/sentry-ruby/spec/sentry/redis_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "spec_helper" RSpec.describe Sentry::Redis do diff --git a/sentry-ruby/spec/sentry/scope/setters_spec.rb b/sentry-ruby/spec/sentry/scope/setters_spec.rb index 6a5378194..39a2e25c1 100644 --- a/sentry-ruby/spec/sentry/scope/setters_spec.rb +++ b/sentry-ruby/spec/sentry/scope/setters_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "spec_helper" RSpec.describe Sentry::Scope do diff --git a/sentry-ruby/spec/sentry/scope_spec.rb b/sentry-ruby/spec/sentry/scope_spec.rb index 6b4b4c168..4bacae275 100644 --- a/sentry-ruby/spec/sentry/scope_spec.rb +++ b/sentry-ruby/spec/sentry/scope_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "spec_helper" RSpec.describe Sentry::Scope do diff --git a/sentry-ruby/spec/sentry/session_flusher_spec.rb b/sentry-ruby/spec/sentry/session_flusher_spec.rb index 0c0fbb4eb..376f71dd4 100644 --- a/sentry-ruby/spec/sentry/session_flusher_spec.rb +++ b/sentry-ruby/spec/sentry/session_flusher_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "spec_helper" RSpec.describe Sentry::SessionFlusher do diff --git a/sentry-ruby/spec/sentry/span_spec.rb b/sentry-ruby/spec/sentry/span_spec.rb index f24876d7f..0d1fd225c 100644 --- a/sentry-ruby/spec/sentry/span_spec.rb +++ b/sentry-ruby/spec/sentry/span_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "spec_helper" RSpec.describe Sentry::Span do diff --git a/sentry-ruby/spec/sentry/test_helper_spec.rb b/sentry-ruby/spec/sentry/test_helper_spec.rb index 2753b9b64..8303464c8 100644 --- a/sentry-ruby/spec/sentry/test_helper_spec.rb +++ b/sentry-ruby/spec/sentry/test_helper_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "spec_helper" RSpec.describe Sentry::TestHelper do diff --git a/sentry-ruby/spec/sentry/transaction_spec.rb b/sentry-ruby/spec/sentry/transaction_spec.rb index effb249f1..7cc83aa64 100644 --- a/sentry-ruby/spec/sentry/transaction_spec.rb +++ b/sentry-ruby/spec/sentry/transaction_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "spec_helper" RSpec.describe Sentry::Transaction do diff --git a/sentry-ruby/spec/sentry/transport/configuration_spec.rb b/sentry-ruby/spec/sentry/transport/configuration_spec.rb index 676a4800c..fa3edd87b 100644 --- a/sentry-ruby/spec/sentry/transport/configuration_spec.rb +++ b/sentry-ruby/spec/sentry/transport/configuration_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "spec_helper" RSpec.describe Sentry::Transport::Configuration do diff --git a/sentry-ruby/spec/sentry/transport/http_transport_rate_limiting_spec.rb b/sentry-ruby/spec/sentry/transport/http_transport_rate_limiting_spec.rb index ac83e3b16..30dc42bbb 100644 --- a/sentry-ruby/spec/sentry/transport/http_transport_rate_limiting_spec.rb +++ b/sentry-ruby/spec/sentry/transport/http_transport_rate_limiting_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' require 'contexts/with_request_mock' diff --git a/sentry-ruby/spec/sentry/transport/http_transport_spec.rb b/sentry-ruby/spec/sentry/transport/http_transport_spec.rb index 3c7b1b051..a0973ef75 100644 --- a/sentry-ruby/spec/sentry/transport/http_transport_spec.rb +++ b/sentry-ruby/spec/sentry/transport/http_transport_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' require 'contexts/with_request_mock' diff --git a/sentry-ruby/spec/sentry/transport/spotlight_transport_spec.rb b/sentry-ruby/spec/sentry/transport/spotlight_transport_spec.rb index 04de57af6..fc095efeb 100644 --- a/sentry-ruby/spec/sentry/transport/spotlight_transport_spec.rb +++ b/sentry-ruby/spec/sentry/transport/spotlight_transport_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' RSpec.describe Sentry::SpotlightTransport do diff --git a/sentry-ruby/spec/sentry/transport_spec.rb b/sentry-ruby/spec/sentry/transport_spec.rb index 079aa8709..059a8109b 100644 --- a/sentry-ruby/spec/sentry/transport_spec.rb +++ b/sentry-ruby/spec/sentry/transport_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' RSpec.describe Sentry::Transport do diff --git a/sentry-ruby/spec/sentry/utils/real_ip_spec.rb b/sentry-ruby/spec/sentry/utils/real_ip_spec.rb index 7aa6c7559..42197b9f2 100644 --- a/sentry-ruby/spec/sentry/utils/real_ip_spec.rb +++ b/sentry-ruby/spec/sentry/utils/real_ip_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' RSpec.describe Sentry::Utils::RealIp do diff --git a/sentry-ruby/spec/sentry/utils/request_id_spec.rb b/sentry-ruby/spec/sentry/utils/request_id_spec.rb index 7fa7a7301..955bd8894 100644 --- a/sentry-ruby/spec/sentry/utils/request_id_spec.rb +++ b/sentry-ruby/spec/sentry/utils/request_id_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "spec_helper" RSpec.describe Sentry::Utils::RequestId do diff --git a/sentry-ruby/spec/sentry/vernier/profiler_spec.rb b/sentry-ruby/spec/sentry/vernier/profiler_spec.rb index 645ddcada..03fe7ebde 100644 --- a/sentry-ruby/spec/sentry/vernier/profiler_spec.rb +++ b/sentry-ruby/spec/sentry/vernier/profiler_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "spec_helper" require "sentry/vernier/profiler" @@ -173,7 +175,7 @@ expect(foo_frame[:function]).to eq('Foo.foo') expect(foo_frame[:module]).to eq('ProfilerTest::Bar') expect(foo_frame[:in_app]).to eq(true) - expect(foo_frame[:lineno]).to eq(4) + expect(foo_frame[:lineno]).to eq(6) expect(foo_frame[:filename]).to eq('spec/support/profiler.rb') expect(foo_frame[:abs_path]).to include('sentry-ruby/sentry-ruby/spec/support/profiler.rb') end @@ -259,7 +261,7 @@ expect(foo_frame[:function]).to eq('Foo.foo') expect(foo_frame[:module]).to eq('ProfilerTest::Bar') expect(foo_frame[:in_app]).to eq(true) - expect(foo_frame[:lineno]).to eq(4) + expect(foo_frame[:lineno]).to eq(6) expect(foo_frame[:filename]).to eq('spec/support/profiler.rb') expect(foo_frame[:abs_path]).to include('sentry-ruby/sentry-ruby/spec/support/profiler.rb') end diff --git a/sentry-ruby/spec/sentry_spec.rb b/sentry-ruby/spec/sentry_spec.rb index dd3f85c93..dabdcd07e 100644 --- a/sentry-ruby/spec/sentry_spec.rb +++ b/sentry-ruby/spec/sentry_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "spec_helper" require 'contexts/with_request_mock' diff --git a/sentry-ruby/spec/spec_helper.rb b/sentry-ruby/spec/spec_helper.rb index 1bceb1070..e0d1c9a1e 100644 --- a/sentry-ruby/spec/spec_helper.rb +++ b/sentry-ruby/spec/spec_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "bundler/setup" begin require "debug/prelude" diff --git a/sentry-ruby/spec/support/Rakefile.rb b/sentry-ruby/spec/support/Rakefile.rb index 2304ba3a4..77b245297 100644 --- a/sentry-ruby/spec/support/Rakefile.rb +++ b/sentry-ruby/spec/support/Rakefile.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "rake" require "sentry-ruby" diff --git a/sentry-ruby/spec/support/profiler.rb b/sentry-ruby/spec/support/profiler.rb index 7f048b8a5..ee83cc4dd 100644 --- a/sentry-ruby/spec/support/profiler.rb +++ b/sentry-ruby/spec/support/profiler.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module ProfilerTest module Bar module Foo diff --git a/sentry-ruby/spec/support/stacktrace_test_fixture.rb b/sentry-ruby/spec/support/stacktrace_test_fixture.rb index 7921fb53b..0c8d7933e 100644 --- a/sentry-ruby/spec/support/stacktrace_test_fixture.rb +++ b/sentry-ruby/spec/support/stacktrace_test_fixture.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + def foo bar end diff --git a/sentry-sidekiq/Gemfile b/sentry-sidekiq/Gemfile index 5ce453b72..c158e85dc 100644 --- a/sentry-sidekiq/Gemfile +++ b/sentry-sidekiq/Gemfile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + source "https://rubygems.org" git_source(:github) { |name| "https://github.com/#{name}.git" } diff --git a/sentry-sidekiq/Rakefile b/sentry-sidekiq/Rakefile index 7b2756854..13afab191 100644 --- a/sentry-sidekiq/Rakefile +++ b/sentry-sidekiq/Rakefile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "bundler/gem_tasks" require "rspec/core/rake_task" diff --git a/sentry-sidekiq/bin/console b/sentry-sidekiq/bin/console index 660c7a889..f0f5a7b6a 100755 --- a/sentry-sidekiq/bin/console +++ b/sentry-sidekiq/bin/console @@ -1,4 +1,5 @@ #!/usr/bin/env ruby +# frozen_string_literal: true require "bundler/setup" require "sentry/ruby" diff --git a/sentry-sidekiq/example/Gemfile b/sentry-sidekiq/example/Gemfile index d038af521..9834edf07 100644 --- a/sentry-sidekiq/example/Gemfile +++ b/sentry-sidekiq/example/Gemfile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + source "https://rubygems.org" gem "sidekiq" diff --git a/sentry-sidekiq/example/error_worker.rb b/sentry-sidekiq/example/error_worker.rb index 220d80f63..8782dd2d7 100644 --- a/sentry-sidekiq/example/error_worker.rb +++ b/sentry-sidekiq/example/error_worker.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "sidekiq" require "sentry-sidekiq" diff --git a/sentry-sidekiq/lib/sentry-sidekiq.rb b/sentry-sidekiq/lib/sentry-sidekiq.rb index b7318b9f9..a126782f2 100644 --- a/sentry-sidekiq/lib/sentry-sidekiq.rb +++ b/sentry-sidekiq/lib/sentry-sidekiq.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "sidekiq" require "sentry-ruby" require "sentry/integrable" diff --git a/sentry-sidekiq/lib/sentry/sidekiq/configuration.rb b/sentry-sidekiq/lib/sentry/sidekiq/configuration.rb index cc71908b5..b6ef3856c 100644 --- a/sentry-sidekiq/lib/sentry/sidekiq/configuration.rb +++ b/sentry-sidekiq/lib/sentry/sidekiq/configuration.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Sentry class Configuration attr_reader :sidekiq diff --git a/sentry-sidekiq/lib/sentry/sidekiq/context_filter.rb b/sentry-sidekiq/lib/sentry/sidekiq/context_filter.rb index 8512b5ab5..ff9f014c3 100644 --- a/sentry-sidekiq/lib/sentry/sidekiq/context_filter.rb +++ b/sentry-sidekiq/lib/sentry/sidekiq/context_filter.rb @@ -1,8 +1,10 @@ +# frozen_string_literal: true + module Sentry module Sidekiq class ContextFilter - ACTIVEJOB_RESERVED_PREFIX_REGEX = /^_aj_/.freeze - SIDEKIQ_NAME = "Sidekiq".freeze + ACTIVEJOB_RESERVED_PREFIX_REGEX = /^_aj_/ + SIDEKIQ_NAME = "Sidekiq" attr_reader :context diff --git a/sentry-sidekiq/lib/sentry/sidekiq/error_handler.rb b/sentry-sidekiq/lib/sentry/sidekiq/error_handler.rb index d1f7eaf87..50c720929 100644 --- a/sentry-sidekiq/lib/sentry/sidekiq/error_handler.rb +++ b/sentry-sidekiq/lib/sentry/sidekiq/error_handler.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "sentry/sidekiq/context_filter" module Sentry diff --git a/sentry-sidekiq/lib/sentry/sidekiq/version.rb b/sentry-sidekiq/lib/sentry/sidekiq/version.rb index 46cb74dbe..7fd496062 100644 --- a/sentry-sidekiq/lib/sentry/sidekiq/version.rb +++ b/sentry-sidekiq/lib/sentry/sidekiq/version.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Sentry module Sidekiq VERSION = "5.20.1" diff --git a/sentry-sidekiq/sentry-sidekiq.gemspec b/sentry-sidekiq/sentry-sidekiq.gemspec index 69a4689de..fe8a94595 100644 --- a/sentry-sidekiq/sentry-sidekiq.gemspec +++ b/sentry-sidekiq/sentry-sidekiq.gemspec @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "lib/sentry/sidekiq/version" Gem::Specification.new do |spec| diff --git a/sentry-sidekiq/spec/sentry/rails_spec.rb b/sentry-sidekiq/spec/sentry/rails_spec.rb index 87518ea06..36c6fdd31 100644 --- a/sentry-sidekiq/spec/sentry/rails_spec.rb +++ b/sentry-sidekiq/spec/sentry/rails_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + return unless ENV["WITH_SENTRY_RAILS"] require "rails" diff --git a/sentry-sidekiq/spec/sentry/sidekiq-scheduler/scheduler_spec.rb b/sentry-sidekiq/spec/sentry/sidekiq-scheduler/scheduler_spec.rb index 879e34a55..02efd1ccc 100644 --- a/sentry-sidekiq/spec/sentry/sidekiq-scheduler/scheduler_spec.rb +++ b/sentry-sidekiq/spec/sentry/sidekiq-scheduler/scheduler_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' return unless defined?(SidekiqScheduler::Scheduler) diff --git a/sentry-sidekiq/spec/sentry/sidekiq/configuration_spec.rb b/sentry-sidekiq/spec/sentry/sidekiq/configuration_spec.rb index 2fdcdfbc5..7e9066ffe 100644 --- a/sentry-sidekiq/spec/sentry/sidekiq/configuration_spec.rb +++ b/sentry-sidekiq/spec/sentry/sidekiq/configuration_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "spec_helper" RSpec.describe Sentry::Sidekiq::Configuration do diff --git a/sentry-sidekiq/spec/sentry/sidekiq/context_filter_spec.rb b/sentry-sidekiq/spec/sentry/sidekiq/context_filter_spec.rb index dc5354b9c..099ce329b 100644 --- a/sentry-sidekiq/spec/sentry/sidekiq/context_filter_spec.rb +++ b/sentry-sidekiq/spec/sentry/sidekiq/context_filter_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "spec_helper" RSpec.describe Sentry::Sidekiq::ContextFilter do diff --git a/sentry-sidekiq/spec/sentry/sidekiq/cron/job_spec.rb b/sentry-sidekiq/spec/sentry/sidekiq/cron/job_spec.rb index c0f223096..4e4f65202 100644 --- a/sentry-sidekiq/spec/sentry/sidekiq/cron/job_spec.rb +++ b/sentry-sidekiq/spec/sentry/sidekiq/cron/job_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' return unless defined?(Sidekiq::Cron::Job) diff --git a/sentry-sidekiq/spec/sentry/sidekiq/error_handler_spec.rb b/sentry-sidekiq/spec/sentry/sidekiq/error_handler_spec.rb index 15053609e..5e144bf9a 100644 --- a/sentry-sidekiq/spec/sentry/sidekiq/error_handler_spec.rb +++ b/sentry-sidekiq/spec/sentry/sidekiq/error_handler_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' RSpec.describe Sentry::Sidekiq::ErrorHandler do diff --git a/sentry-sidekiq/spec/sentry/sidekiq/sentry_context_middleware_spec.rb b/sentry-sidekiq/spec/sentry/sidekiq/sentry_context_middleware_spec.rb index 8d28577e7..de5e9416f 100644 --- a/sentry-sidekiq/spec/sentry/sidekiq/sentry_context_middleware_spec.rb +++ b/sentry-sidekiq/spec/sentry/sidekiq/sentry_context_middleware_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "spec_helper" RSpec.shared_context "sidekiq", shared_context: :metadata do diff --git a/sentry-sidekiq/spec/sentry/sidekiq_spec.rb b/sentry-sidekiq/spec/sentry/sidekiq_spec.rb index 2e7cfb99a..64fdec5c1 100644 --- a/sentry-sidekiq/spec/sentry/sidekiq_spec.rb +++ b/sentry-sidekiq/spec/sentry/sidekiq_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "spec_helper" require 'sidekiq/manager' require 'sidekiq/api' diff --git a/sentry-sidekiq/spec/spec_helper.rb b/sentry-sidekiq/spec/spec_helper.rb index 6b2287957..5e1e6a6e9 100644 --- a/sentry-sidekiq/spec/spec_helper.rb +++ b/sentry-sidekiq/spec/spec_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "bundler/setup" begin require "debug/prelude"