From 167a529cec4887e95e594e261bc0b1f4e57643c6 Mon Sep 17 00:00:00 2001 From: unkin-agent Date: Wed, 9 Sep 2026 23:28:52 +1000 Subject: [PATCH 1/2] Format the tree with stylua --- tests/installer_spec.lua | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/installer_spec.lua b/tests/installer_spec.lua index 330612d..b1ec306 100644 --- a/tests/installer_spec.lua +++ b/tests/installer_spec.lua @@ -60,9 +60,12 @@ local function run(ctx, specs) installer.run(ctx, specs, function(r) results = r end) - assert(vim.wait(30000, function() - return results ~= nil - end, 20), 'installer.run never called back') + assert( + vim.wait(30000, function() + return results ~= nil + end, 20), + 'installer.run never called back' + ) return results end -- 2.47.3 From 73960b03e21de786663653070a6fd49832eff416 Mon Sep 17 00:00:00 2001 From: unkin-agent Date: Wed, 9 Sep 2026 23:29:48 +1000 Subject: [PATCH 2/2] Gate pull requests on stylua formatting - add a fmt-check make target running stylua --check over lua, tests and plugin - add a fmt step to the lint pipeline fetching pinned stylua v2.5.2 - verify the download against its sha256 before use --- .woodpecker/lint.yaml | 32 ++++++++++++++++++++++++++++++++ Makefile | 9 +++++++-- 2 files changed, 39 insertions(+), 2 deletions(-) diff --git a/.woodpecker/lint.yaml b/.woodpecker/lint.yaml index 92c873c..cca5f57 100644 --- a/.woodpecker/lint.yaml +++ b/.woodpecker/lint.yaml @@ -17,3 +17,35 @@ steps: limits: memory: 2Gi cpu: 2 + + # stylua ships no apk package, so pull the pinned musl release through the + # artifact proxy and check the checksum. The proxy's TLS leaf chains to the + # internal CA, which alpine does not trust, so fetch over the plain-HTTP + # listener and let the digest carry integrity. + - name: fmt + image: alpine:3.22 + environment: + STYLUA_VERSION: v2.5.2 + STYLUA_SHA256: ca6f1cf52eaf69e6632b81acef9c197aa24b85eb30d2455a35e7dbe28ae77c72 + commands: + - apk add --no-cache curl unzip make + - | + HOST="http://artifactapi.k8s.syd1.au.unkin.net" + ZIP="stylua-linux-x86_64-musl.zip" + curl -fsSL -o /tmp/$$ZIP \ + "$$HOST/api/v1/remote/github/JohnnyMorganz/StyLua/releases/download/$${STYLUA_VERSION}/$$ZIP" + echo "$${STYLUA_SHA256} /tmp/$$ZIP" | sha256sum -c - + unzip -o -d /usr/local/bin /tmp/$$ZIP + chmod +x /usr/local/bin/stylua + - stylua --version + - make fmt-check + backend_options: + kubernetes: + serviceAccountName: default + resources: + requests: + memory: 256Mi + cpu: 500m + limits: + memory: 1Gi + cpu: 1 diff --git a/Makefile b/Makefile index fafd95e..3c510f2 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: test lint fmt pre-commit package verify-package patch minor major _tag +.PHONY: test lint fmt fmt-check pre-commit package verify-package patch minor major _tag VERSION ?= $(shell git describe --tags --always) # Archive names drop the leading "v", the way tag source archives do. @@ -12,8 +12,13 @@ test: lint: luacheck lua tests +LUA_SOURCES = lua tests plugin + fmt: - stylua lua tests + stylua $(LUA_SOURCES) + +fmt-check: + stylua --check $(LUA_SOURCES) pre-commit: @uvx pre-commit run --all-files -- 2.47.3