universe: go: add golangci-lint support
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
This commit is contained in:
parent
cf3993a235
commit
b989c5d661
37
pkg/universe.dagger.io/go/golangci/lint.cue
Normal file
37
pkg/universe.dagger.io/go/golangci/lint.cue
Normal file
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user