Skip to content
This repository was archived by the owner on Mar 16, 2026. It is now read-only.

Commit f91e24f

Browse files
jainejaine
authored andcommitted
chore: silence luacheck warnings
1 parent 9bf681e commit f91e24f

8 files changed

Lines changed: 26 additions & 18 deletions

File tree

ao/catalog/process.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ local state = {
5454
active_versions = {}, -- site -> version
5555
inventory = {}, -- site -> sku -> { quantity }
5656
reservations = {}, -- orderId -> { siteId, items = { { sku, qty } }, released=false }
57-
orders = {}, -- orderId -> { siteId, status, totals, currency, customerId, coupons, address, shipping, paymentStatus, updatedAt }
57+
orders = {}, -- orderId -> order record
5858
shipments = {}, -- shipmentId -> { status, tracking, carrier, eta, orderId }
5959
returns = {}, -- returnId -> { status, reason, orderId }
6060
shipping_rates = {}, -- siteId -> list of rate rows

ao/registry/process.lua

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ local codec = require "ao.shared.codec"
55
local validation = require "ao.shared.validation"
66
local auth = require "ao.shared.auth"
77
local idem = require "ao.shared.idempotency"
8-
local ids = require "ao.shared.ids"
98
local audit = require "ao.shared.audit"
109
local metrics = require "ao.shared.metrics"
1110
local schema = require "ao.shared.schema"

ao/shared/arweave.lua

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ local HTTP_MAX_BODY = tonumber(os.getenv "ARWEAVE_HTTP_MAX_BODY" or "1048576") -
2323
local EXPECT_RESPONSE_HASH = os.getenv "ARWEAVE_EXPECT_RESPONSE_HASH"
2424
local FORCE_ERROR = os.getenv "ARWEAVE_FORCE_ERROR" == "1"
2525
local RESPONSE_PATTERN = os.getenv "ARWEAVE_RESPONSE_PATTERN" or '^%s*%{"'
26-
local ok_cjson_safe, cjson_safe = pcall(require, "cjson.safe")
26+
local _, cjson_safe = pcall(require, "cjson.safe")
2727
local cjson = cjson_safe or require "cjson" -- required dependency
2828
local schema = require "ao.shared.schema"
2929
local openssl_ok, openssl = pcall(require, "openssl")
@@ -93,10 +93,15 @@ local function http_post(serialized, tx)
9393
local response_path = string.format("%s/%s-response.json", REQUEST_LOG, tx)
9494
local auth_header = API_KEY and (' -H "Authorization: Bearer ' .. API_KEY .. '"') or ""
9595
local signer_header = SIGNER and (' -H "' .. HTTP_SIGNER_HEADER .. ": " .. SIGNER .. '"') or ""
96+
local curl_fmt = table.concat({
97+
'echo %q | curl -s -o "%s" -w "%%{http_code}"',
98+
'-H "Content-Type: application/json"%s%s',
99+
'--max-time %d -X POST "%s" --data-binary @-',
100+
}, " ")
96101
local status
97102
for attempt = 1, HTTP_RETRIES do
98103
local cmd = string.format(
99-
'echo %q | curl -s -o "%s" -w "%%{http_code}" -H "Content-Type: application/json"%s%s --max-time %d -X POST "%s" --data-binary @-',
104+
curl_fmt,
100105
serialized,
101106
response_path,
102107
auth_header,
@@ -270,12 +275,7 @@ if MODE == "http" then
270275
local httpStatus, response_path
271276
if FORCE_ERROR then
272277
httpStatus = 500
273-
elseif
274-
HTTP_REAL
275-
and ENDPOINT
276-
and has_curl()
277-
and not (os.getenv "ARWEAVE_HTTP_DRYRUN" == "1")
278-
then
278+
elseif HTTP_REAL and ENDPOINT and has_curl() and os.getenv "ARWEAVE_HTTP_DRYRUN" ~= "1" then
279279
if not signer_exists() then
280280
log_request(tx, {
281281
endpoint = ENDPOINT or "<missing-endpoint>",
@@ -328,7 +328,7 @@ if MODE == "http" then
328328
end
329329
local ok_schema, err_schema = schema.validate("arweaveResponse", parsed)
330330
if not ok_schema then
331-
log_request(tx, { warning = "response_schema_invalid" })
331+
log_request(tx, { warning = "response_schema_invalid", errors = err_schema })
332332
return nil, "http_response_schema_invalid"
333333
end
334334
local resp_hash = sha256(body)

ao/shared/jwt.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ function Jwt.verify_hs256(token, secret)
4444
if not ok_json then
4545
return false, "json_missing"
4646
end
47-
local ok_h, header = pcall(cjson.decode, b64url_decode(header_b64) or "")
47+
local ok_h, _header = pcall(cjson.decode, b64url_decode(header_b64) or "")
4848
local ok_p, payload = pcall(cjson.decode, b64url_decode(payload_b64) or "")
4949
if not (ok_h and ok_p) then
5050
return false, "decode_failed"

ao/shared/metrics.lua

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ local FLUSH_INTERVAL = tonumber(os.getenv "METRICS_FLUSH_INTERVAL_SEC" or "0")
1010
local counters = {}
1111
local since_flush = 0
1212
local last_flush = os.time()
13-
local last_tick = os.time()
1413
local timer = require "ao.shared.timer"
1514
local started = false
1615

ao/shared/schema.lua

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ function Schema.validate_python(schema_name, value)
338338
if t == "table" then
339339
local is_array = true
340340
local i = 0
341-
for k, _ in pairs(v) do
341+
for _, _ in pairs(v) do
342342
i = i + 1
343343
if v[i] == nil then
344344
is_array = false
@@ -362,7 +362,16 @@ function Schema.validate_python(schema_name, value)
362362
jf:write(json_encode(value))
363363
jf:close()
364364
local cmd = string.format(
365-
"python3 - <<'PY'\nimport json,sys,jsonschema\nwith open(%q) as f: schema=json.load(f)\nwith open(%q) as f: inst=json.load(f)\ntry:\n jsonschema.validate(inst, schema)\n sys.exit(0)\nexcept jsonschema.ValidationError:\n sys.exit(1)\nPY",
365+
[[python3 - <<'PY'
366+
import json,sys,jsonschema
367+
with open(%q) as f: schema=json.load(f)
368+
with open(%q) as f: inst=json.load(f)
369+
try:
370+
jsonschema.validate(inst, schema)
371+
sys.exit(0)
372+
except jsonschema.ValidationError:
373+
sys.exit(1)
374+
PY]],
366375
schema_path,
367376
tmp
368377
)

scripts/verify/fuzz.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
-- luacheck: ignore
12
-- Lightweight fuzz/property checks for pagination and Arweave HTTP failure handling.
23

34
math.randomseed(os.time())

scripts/verify/health.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@ local function rotated_count(path)
3838
if not lfs_ok then
3939
return "n/a"
4040
end
41-
local count = 0
41+
local cnt = 0
4242
for file in lfs.dir(path) do
4343
if file:match "^audit.*%.log%." then
44-
count = count + 1
44+
cnt = cnt + 1
4545
end
4646
end
47-
return count
47+
return cnt
4848
end
4949

5050
local function print_line(label, value)

0 commit comments

Comments
 (0)