From 2dfe2fccbeedc01fa1718037e2571706a83d8dc3 Mon Sep 17 00:00:00 2001 From: Andrea Luzzardi Date: Fri, 8 Jan 2021 17:29:06 +0100 Subject: [PATCH] linter: ensure make generate is up to date Signed-off-by: Andrea Luzzardi --- Makefile | 9 +++++---- dagger/gen.go | 46 ++++++++++++++++++++++------------------------ 2 files changed, 27 insertions(+), 28 deletions(-) diff --git a/Makefile b/Makefile index b406d3bb..1fb8c2e8 100644 --- a/Makefile +++ b/Makefile @@ -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)" \ No newline at end of file + @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)" diff --git a/dagger/gen.go b/dagger/gen.go index 87dacbef..0ffcccf9 100644 --- a/dagger/gen.go +++ b/dagger/gen.go @@ -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"]}, ] `