Gate pull requests on stylua formatting #3
Reference in New Issue
Block a user
Delete Branch "benvin/stylua-check"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The repo ships a .stylua.toml and a make fmt target, but nothing has ever run the formatter, so style drift lands unnoticed. Pull requests now fail when Lua source does not match the configured style.
Blocking:
.woodpecker/lint.yaml,fmtstep — the fetch script never runs.HOSTandZIPare locally-defined shell vars but are referenced as$$HOST/$$ZIP(bare, no braces). Woodpecker's${...}preprocessor (drone/envsubst) only rewrites braced${VAR}forms — bare$VARpasses through untouched. So$$HOST/$$ZIPreach the container's/bin/shliterally, where$$is the shell's own PID special variable, followed by literal trailing textHOST/ZIP.Verified in podman/alpine:3.22 with the exact commands from this diff: the curl call resolves to
curl: (6) Could not resolve host: <pid>HOSTevery run — the step fails before it ever reachesmake fmt-check. This gate does not gate; it just reds out unconditionally on every PR, always, regardless of formatting.Fix: use plain
$HOSTand$ZIPfor the two locally-defined vars (no escaping needed — Woodpecker never touches bare$VAR). Keep$${STYLUA_VERSION}and$${STYLUA_SHA256}escaped as-is — those are real${...}-braced references into Woodpecker-injectedenvironment:vars and do need it.Everything else checks out: the pinned sha256 matches GitHub's own release digest for v2.5.2 exactly (verified via the GitHub API digest field, and by round-tripping through the artifactapi proxy), the version is explicitly pinned,
LUA_SOURCESin the Makefile covers every.luadirectory the repo ships, the reformat commit is separate and purely cosmetic, and.stylua.tomlcolumn_width agrees with.luacheckrcmax_line_length (120/120).