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 .PHONY: generate
generate: generate:
go generate ./dagger @go generate ./dagger
.PHONY: dagger .PHONY: dagger
dagger: generate dagger: generate
@ -11,9 +11,10 @@ dagger: generate
.PHONY: cuefmt .PHONY: cuefmt
cuefmt: cuefmt:
(cd ./dagger && cue fmt -s ./... && cue trim -s ./...) @(cd ./dagger && cue fmt -s ./... && cue trim -s ./...)
.PHONY: lint .PHONY: lint
lint: lint: generate cuefmt
golangci-lint run 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 .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 compute?: #Script
} }
// Any component can be referenced as a directory, since // Any component can be referenced as a directory, since
// every dagger script outputs a filesystem state (aka a directory) // every dagger script outputs a filesystem state (aka a directory)
#Dir: #Component #Dir: #Component
@ -66,7 +64,7 @@ package dagger
do: "export" do: "export"
// Source path in the container // Source path in the container
source: string source: string
format: "json"|"yaml"|*"string"|"number"|"boolean" format: "json" | "yaml" | *"string" | "number" | "boolean"
} }
#Local: { #Local: {
@ -121,7 +119,7 @@ package dagger
} }
#TestScript: #Script & [ #TestScript: #Script & [
{ do: "fetch-container", ref: "alpine:latest" }, {do: "fetch-container", ref: "alpine:latest"},
{ do: "exec", args: ["echo", "hello", "world" ] } {do: "exec", args: ["echo", "hello", "world"]},
] ]
` `