From 67bcd9bf722a28d16c5a5784edb9bc849e09969d Mon Sep 17 00:00:00 2001 From: Chaitanya Bhorade Date: Thu, 1 Oct 2026 16:02:10 -0700 Subject: [PATCH] fix(ci): rubocop Style/DirectiveScope and json pretty_unparse removal Recent rubocop and json gem releases broke CI on main. rubocop 1.90 added Style/DirectiveScope which flags the Style/RedundantSelf disable/enable pair in configure_client. Dropped the pair and switched self.superclass to superclass. json 3.0.0 removed JSON.pretty_unparse. Swapped the two call sites in transactions.rb to JSON.pretty_generate. Runtime behavior unchanged in both cases. record.rb#table_name has the same pattern but rubocop isn't flagging it, so leaving that one alone for now. --- lib/aws-record/record/client_configuration.rb | 6 ++---- lib/aws-record/record/transactions.rb | 4 ++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/aws-record/record/client_configuration.rb b/lib/aws-record/record/client_configuration.rb index c8279a8..15a015e 100644 --- a/lib/aws-record/record/client_configuration.rb +++ b/lib/aws-record/record/client_configuration.rb @@ -25,14 +25,12 @@ module ClientConfiguration # @option opts [Aws::DynamoDB::Client] :client allows you to pass in your # own pre-configured client. def configure_client(opts = {}) - # rubocop:disable Style/RedundantSelf @dynamodb_client = if self.class != Module && Aws::Record.extends_record?(self) && opts.empty? && - self.superclass.instance_variable_get('@dynamodb_client') - self.superclass.instance_variable_get('@dynamodb_client') + superclass.instance_variable_get('@dynamodb_client') + superclass.instance_variable_get('@dynamodb_client') else _build_client(opts) end - # rubocop:enable Style/RedundantSelf end # Gets the diff --git a/lib/aws-record/record/transactions.rb b/lib/aws-record/record/transactions.rb index 90f194e..b678026 100644 --- a/lib/aws-record/record/transactions.rb +++ b/lib/aws-record/record/transactions.rb @@ -258,8 +258,8 @@ def _transform_save_record(save_record, opts) 'currently supported. You should rewrite this case to use ' \ 'a :put transaction, adding the existence check to your ' \ "own condition expression if desired.\n" \ - "\tItem: #{JSON.pretty_unparse(save_record.to_h)}\n" \ - "\tExtra Options: #{JSON.pretty_unparse(opts)}" + "\tItem: #{JSON.pretty_generate(save_record.to_h)}\n" \ + "\tExtra Options: #{JSON.pretty_generate(opts)}" else opts = opts.merge(safety_expression) _transform_put_record(save_record, opts)