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

@ -15,14 +15,14 @@ package dagger
// The DAG architecture has many benefits:
// - Because DAGs are made of nodes executing in parallel, they are easy to scale.
// - Because all inputs and outputs are snapshotted and content-addressed, DAGs
// can easily be made repeatable, can be cached aggressively, and can be replayed
// at will.
// can easily be made repeatable, can be cached aggressively, and can be replayed
// at will.
// - Because nodes are executed by the same container engine as docker-build, DAGs
// can be developed using any language or technology capable of running in a docker.
// Dockerfiles and docker images are natively supported for maximum compatibility.
// can be developed using any language or technology capable of running in a docker.
// Dockerfiles and docker images are natively supported for maximum compatibility.
//
// - Because DAGs are programmed declaratively with a powerful configuration language,
// they are much easier to test, debug and refactor than traditional programming languages.
// they are much easier to test, debug and refactor than traditional programming languages.
//
// To execute a DAG, the dagger runtime JIT-compiles it to a low-level format called
// llb, and executes it with buildkit.
@ -47,11 +47,9 @@ package dagger
// The contents of a #dagger annotation
#ComponentConfig: {
// script to compute the value
compute?: #Script
compute?: #Script
}
// Any component can be referenced as a directory, since
// every dagger script outputs a filesystem state (aka a directory)
#Dir: #Component
@ -66,19 +64,19 @@ package dagger
do: "export"
// Source path in the container
source: string
format: "json"|"yaml"|*"string"|"number"|"boolean"
format: "json" | "yaml" | *"string" | "number" | "boolean"
}
#Local: {
do: "local"
dir: string
do: "local"
dir: string
include?: [...string] | *[]
}
// FIXME: bring back load (more efficient than copy)
#Load: {
do: "load"
do: "load"
from: #Component | #Script
}
@ -87,41 +85,41 @@ package dagger
args: [...string]
env?: [string]: string
always?: true | *false
dir: string | *"/"
dir: string | *"/"
mount?: [string]: #MountTmp | #MountCache | #MountComponent | #MountScript
}
#MountTmp: "tmpfs"
#MountTmp: "tmpfs"
#MountCache: "cache"
#MountComponent: {
input: #Component
path: string | *"/"
path: string | *"/"
}
#MountScript: {
input: #Script
path: string | *"/"
path: string | *"/"
}
#FetchContainer: {
do: "fetch-container"
do: "fetch-container"
ref: string
}
#FetchGit: {
do: "fetch-git"
do: "fetch-git"
remote: string
ref: string
ref: string
}
#Copy: {
do: "copy"
from: #Script | #Component
src?: string | *"/"
do: "copy"
from: #Script | #Component
src?: string | *"/"
dest?: string | *"/"
}
#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"]},
]
`