From b989c5d6615db19e1713b3def9c95b75748aef54 Mon Sep 17 00:00:00 2001 From: Andrea Luzzardi Date: Thu, 31 Mar 2022 19:21:43 -0700 Subject: [PATCH] universe: go: add golangci-lint support Signed-off-by: Andrea Luzzardi --- pkg/universe.dagger.io/go/golangci/lint.cue | 37 +++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 pkg/universe.dagger.io/go/golangci/lint.cue diff --git a/pkg/universe.dagger.io/go/golangci/lint.cue b/pkg/universe.dagger.io/go/golangci/lint.cue new file mode 100644 index 00000000..32008ff5 --- /dev/null +++ b/pkg/universe.dagger.io/go/golangci/lint.cue @@ -0,0 +1,37 @@ +package golangci + +import ( + "dagger.io/dagger" + + "universe.dagger.io/docker" + "universe.dagger.io/go" +) + +// Lint using golangci-lint +#Lint: { + // Source code + source: dagger.#FS + + // golangci-lint version + version: *"1.45" | string + + // timeout + timeout: *"5m" | string + + _image: docker.#Pull & { + source: "golangci/golangci-lint:v\(version)" + } + + container: go.#Container & { + "source": source + input: _image.output + command: { + name: "golangci-lint" + flags: { + run: true + "-v": true + "--timeout": timeout + } + } + } +}