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/ci/shellcheck/shellcheck.cue
Andrea Luzzardi 162949d87d ci: lint dagger using dagger
- `Makefile` now uses `dagger do lint` to lint
- GHA uses dagger to lint

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2022-04-06 18:42:18 -07:00

35 lines
594 B
CUE

package shellcheck
import (
"dagger.io/dagger"
"universe.dagger.io/docker"
)
#Lint: {
// Source code
source: dagger.#FS
// shellcheck version
version: *"0.8.0" | string
_image: docker.#Pull & {
source: "koalaman/shellcheck-alpine:v\(version)"
}
docker.#Run & {
input: _image.output
mounts: "source": {
dest: "/src"
contents: source
}
workdir: "/src"
command: {
name: "sh"
args: ["-c", #"""
shellcheck $(find . -type f \( -iname \*.bats -o -iname \*.bash -o -iname \*.sh \) -not -path "*/node_modules/*" -not -path "*/bats-*/*")
"""#]
}
}
}