From 608ca7e87635d40159bb78205614e510e06589bf Mon Sep 17 00:00:00 2001 From: Keenan Brock Date: Tue, 8 Oct 2024 14:26:40 -0400 Subject: [PATCH 1/2] Minor rubocop fixes in step_functions --- tools/step_functions | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tools/step_functions b/tools/step_functions index bfc10429..3179d476 100755 --- a/tools/step_functions +++ b/tools/step_functions @@ -22,7 +22,7 @@ Optimist.options do banner "Commands:" SUB_COMMANDS.each { |k, v| banner " #{k.ljust(14)}#{v}" } banner "" - banner " For more help with a specific command use #{$0} --help" + banner " For more help with a specific command use #{$PROGRAM_NAME} --help" banner "" banner "Global Options:" stop_on SUB_COMMANDS.keys @@ -39,7 +39,7 @@ def aws_stepfunctions(args) puts output.pretty_inspect.light_black if ENV["DEBUG"] output rescue JSON::ParserError => err - $stderr.puts "ERROR: #{err}".light_red if ENV["DEBUG"] + warn "ERROR: #{err}".light_red if ENV["DEBUG"] {} end @@ -57,7 +57,7 @@ def execute_stepfunction(definition, input) status, output = aws_stepfunctions("describe-execution --execution-arn #{execution_arn}").values_at("status", "output") if status == "FAILED" - $stderr.puts "ERROR: Execution failed. See simulator for reason.".light_red + warn "ERROR: Execution failed. See simulator for reason.".light_red exit 1 end ensure @@ -86,7 +86,7 @@ def intrinsic banner SUB_COMMANDS["intrinsic"] banner "" - opt :function, "The intrinsic function or JSONPath to run", :type => :string, :required => :true + opt :function, "The intrinsic function or JSONPath to run", :type => :string, :required => true opt :input, "Input to the execution", :type => :string end @@ -94,12 +94,12 @@ def intrinsic definition = { "StartAt" => "ExecState", - "States" => { + "States" => { "ExecState" => { - "Type" => "Pass", + "Type" => "Pass", "Parameters" => {"data.$" => opts[:function]}, "OutputPath" => "$.data", - "End" => true + "End" => true } } }.to_json From 9f019bcf839b53c7b24dd9ae84a6926d1148d389 Mon Sep 17 00:00:00 2001 From: Keenan Brock Date: Tue, 8 Oct 2024 14:44:09 -0400 Subject: [PATCH 2/2] Minor rubocop in map_spec --- spec/workflow/states/map_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/workflow/states/map_spec.rb b/spec/workflow/states/map_spec.rb index a6c2ad73..9166a8c5 100644 --- a/spec/workflow/states/map_spec.rb +++ b/spec/workflow/states/map_spec.rb @@ -211,7 +211,7 @@ end context "with all iterations failed" do - before { ctx.state["ItemProcessorContext"].each { |ctx| ctx["State"] = {"Output" => {"Error" => "FAILED!"}}} } + before { ctx.state["ItemProcessorContext"].each { |ctx| ctx["State"] = {"Output" => {"Error" => "FAILED!"}} } } it "returns false" do expect(state.success?(ctx)).to be_falsey