linter: ensure make generate is up to date

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
This commit is contained in:
Andrea Luzzardi 2021-01-08 17:29:06 +01:00
parent 4ffcdbf359
commit 2dfe2fccbe
2 changed files with 27 additions and 28 deletions

View File

@ -3,7 +3,7 @@ all: dagger
.PHONY: generate
generate:
go generate ./dagger
@go generate ./dagger
.PHONY: dagger
dagger: generate
@ -11,9 +11,10 @@ dagger: generate
.PHONY: cuefmt
cuefmt:
(cd ./dagger && cue fmt -s ./... && cue trim -s ./...)
@(cd ./dagger && cue fmt -s ./... && cue trim -s ./...)
.PHONY: lint
lint:
lint: generate cuefmt
golangci-lint run
@test -z "$$(git status -s . | grep -e "^ M" | grep .cue | cut -d ' ' -f3 | tee /dev/stderr)"
@test -z "$$(git status -s . | grep -e "^ M" | grep gen.go | cut -d ' ' -f3 | tee /dev/stderr)"

View File

@ -50,8 +50,6 @@ package dagger
compute?: #Script
}
// Any component can be referenced as a directory, since
// every dagger script outputs a filesystem state (aka a directory)
#Dir: #Component
@ -66,7 +64,7 @@ package dagger
do: "export"
// Source path in the container
source: string
format: "json"|"yaml"|*"string"|"number"|"boolean"
format: "json" | "yaml" | *"string" | "number" | "boolean"
}
#Local: {
@ -121,7 +119,7 @@ package dagger
}
#TestScript: #Script & [
{ do: "fetch-container", ref: "alpine:latest" },
{ do: "exec", args: ["echo", "hello", "world" ] }
{do: "fetch-container", ref: "alpine:latest"},
{do: "exec", args: ["echo", "hello", "world"]},
]
`