From 225716d140085fbf69733ebc6fdacc5d3352ac51 Mon Sep 17 00:00:00 2001 From: CarterPerez-dev Date: Wed, 29 Apr 2026 01:43:56 -0400 Subject: [PATCH] fix(env_file): rename _s -> s on commit/rollback_apply to match parent Crystal's compiler warns when an overriding method's parameter name differs from the parent's, since named-argument callers would pass the wrong slot. Underscore-prefix was meant as 'unused' but it changed the parameter name, which Crystal correctly flagged. Match the parent signature (s : Domain::NewSecret) and use the explicit '_ = s' idiom inside the body to mark it intentionally unused. Now 'shards build cre' compiles with zero warnings. --- .../src/cre/rotators/env_file.cr | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/PROJECTS/intermediate/credential-rotation-enforcer/src/cre/rotators/env_file.cr b/PROJECTS/intermediate/credential-rotation-enforcer/src/cre/rotators/env_file.cr index e0c28410..e349ea17 100644 --- a/PROJECTS/intermediate/credential-rotation-enforcer/src/cre/rotators/env_file.cr +++ b/PROJECTS/intermediate/credential-rotation-enforcer/src/cre/rotators/env_file.cr @@ -62,14 +62,16 @@ module CRE::Rotators content.includes?(expected_line) && content.bytesize > 0 end - def commit(c : Domain::Credential, _s : Domain::NewSecret) : Nil + def commit(c : Domain::Credential, s : Domain::NewSecret) : Nil + _ = s path = c.tag("path").not_nil! pending_path = "#{path}.pending" raise RotatorError.new("pending file missing at commit time: #{pending_path}") unless File.exists?(pending_path) File.rename(pending_path, path) end - def rollback_apply(c : Domain::Credential, _s : Domain::NewSecret) : Nil + def rollback_apply(c : Domain::Credential, s : Domain::NewSecret) : Nil + _ = s path = c.tag("path").not_nil! pending_path = "#{path}.pending" File.delete(pending_path) if File.exists?(pending_path)