This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
dagger/pkg/universe.dagger.io/x/teddylear@protonmail.com/lua/fmtCheck.cue

44 lines
623 B
CUE
Raw Normal View History

package lua
import (
"dagger.io/dagger"
"universe.dagger.io/docker"
)
// Checks lua format via Stylua
#StyluaCheck: {
// Files to Copy
source: dagger.#FS
// Any extra formatting args
extraArgs: [...string]
_run: docker.#Build & {
steps: [
docker.#Pull & {
source: "rust:latest"
},
docker.#Run & {
command: {
name: "cargo"
args: ["install", "stylua"]
}
},
docker.#Copy & {
dest: "/tmp"
contents: source
},
docker.#Run & {
command: {
name: "stylua"
args: ["--check", "."] + extraArgs
}
workdir: "/tmp"
},
]
}
}