From ee75e6844ecac5b6815e77e468819791ea451c55 Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Sun, 8 Mar 2026 19:54:06 -0400 Subject: [PATCH] ci: format --- lua/pending/sync/s3.lua | 25 +++++++++++++++++++------ spec/s3_spec.lua | 10 ++++++++-- 2 files changed, 27 insertions(+), 8 deletions(-) diff --git a/lua/pending/sync/s3.lua b/lua/pending/sync/s3.lua index f2f64bb..3c2cee3 100644 --- a/lua/pending/sync/s3.lua +++ b/lua/pending/sync/s3.lua @@ -43,11 +43,22 @@ local function ensure_sync_id(task) bytes[9] = bit.bor(bit.band(bytes[9], 0x3f), 0x80) sync_id = string.format( '%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x', - bytes[1], bytes[2], bytes[3], bytes[4], - bytes[5], bytes[6], - bytes[7], bytes[8], - bytes[9], bytes[10], - bytes[11], bytes[12], bytes[13], bytes[14], bytes[15], bytes[16] + bytes[1], + bytes[2], + bytes[3], + bytes[4], + bytes[5], + bytes[6], + bytes[7], + bytes[8], + bytes[9], + bytes[10], + bytes[11], + bytes[12], + bytes[13], + bytes[14], + bytes[15], + bytes[16] ) task._extra['_s3_sync_id'] = sync_id task.modified = os.date('!%Y-%m-%dT%H:%M:%SZ') --[[@as string]] @@ -97,7 +108,9 @@ function M.auth(args) else log.error('s3: SSO login failed — ' .. (login_result.stderr or '')) end - elseif stderr:find('Unable to locate credentials') or stderr:find('NoCredentialProviders') then + elseif + stderr:find('Unable to locate credentials') or stderr:find('NoCredentialProviders') + then log.error('s3: no AWS credentials configured. See :h pending-s3') else log.error('s3: ' .. stderr) diff --git a/spec/s3_spec.lua b/spec/s3_spec.lua index 5904196..137b209 100644 --- a/spec/s3_spec.lua +++ b/spec/s3_spec.lua @@ -61,7 +61,9 @@ describe('s3', function() local task = { _extra = nil, modified = '2026-01-01T00:00:00Z' } local id = s3._ensure_sync_id(task) assert.is_not_nil(id) - assert.truthy(id:match('^%x%x%x%x%x%x%x%x%-%x%x%x%x%-%x%x%x%x%-%x%x%x%x%-%x%x%x%x%x%x%x%x%x%x%x%x$')) + assert.truthy( + id:match('^%x%x%x%x%x%x%x%x%-%x%x%x%x%-%x%x%x%x%-%x%x%x%x%-%x%x%x%x%x%x%x%x%x%x%x%x$') + ) assert.equals(id, task._extra['_s3_sync_id']) end) @@ -79,7 +81,11 @@ describe('s3', function() it('reports success on valid credentials', function() util.system = function(args) if vim.tbl_contains(args, 'get-caller-identity') then - return { code = 0, stdout = '{"Account":"123456","Arn":"arn:aws:iam::user/test"}', stderr = '' } + return { + code = 0, + stdout = '{"Account":"123456","Arn":"arn:aws:iam::user/test"}', + stderr = '', + } end return { code = 0, stdout = '', stderr = '' } end