From 2bb6445e56c4ddf68e6262830ce78b414834d234 Mon Sep 17 00:00:00 2001 From: Andrea Luzzardi Date: Tue, 12 Apr 2022 16:28:43 -0700 Subject: [PATCH] ci: fix CUE linter Signed-off-by: Andrea Luzzardi --- ci/cue/lint.cue | 4 +++- pkg/universe.dagger.io/python/test/test.cue | 4 ++-- .../x/teddylear@protonmail.com/lua/fmtCheck.cue | 10 +++++----- .../x/teddylear@protonmail.com/lua/test/fmtCheck.cue | 9 ++------- tests/plan/client/env/default.cue | 4 ++-- tests/plan/client/env/usage.cue | 4 ++-- 6 files changed, 16 insertions(+), 19 deletions(-) diff --git a/ci/cue/lint.cue b/ci/cue/lint.cue index 6aac2651..5f2ac1a1 100644 --- a/ci/cue/lint.cue +++ b/ci/cue/lint.cue @@ -39,7 +39,7 @@ import ( // CACHE: copy only *.cue files docker.#Copy & { contents: source - include: ["*.cue", "**/*.cue"] + include: [".git", "*.cue", "**/*.cue"] dest: "/cue" }, @@ -47,6 +47,8 @@ import ( bash.#Run & { workdir: "/cue" script: contents: #""" + git status + find . -name '*.cue' -not -path '*/cue.mod/*' -print | time xargs -t -n 1 -P 8 cue fmt -s test -z "$(git status -s . | grep -e "^ M" | grep "\.cue" | cut -d ' ' -f3 | tee /dev/stderr)" """# diff --git a/pkg/universe.dagger.io/python/test/test.cue b/pkg/universe.dagger.io/python/test/test.cue index ef4d9dc4..b1681d57 100644 --- a/pkg/universe.dagger.io/python/test/test.cue +++ b/pkg/universe.dagger.io/python/test/test.cue @@ -12,14 +12,14 @@ dagger.#Plan & { // Run with a custom path to python customPath: { - + // python:3.10-alpine has both python3 and python in the PATH _image: docker.#Pull & { source: "python:3.10-alpine" } run: python.#Run & { input: _image.output - command: name: "python" + command: name: "python" script: contents: #"print("Hello, world!")"# } // This needs no output test because it is only testing that the command runs diff --git a/pkg/universe.dagger.io/x/teddylear@protonmail.com/lua/fmtCheck.cue b/pkg/universe.dagger.io/x/teddylear@protonmail.com/lua/fmtCheck.cue index 19addf41..023850be 100644 --- a/pkg/universe.dagger.io/x/teddylear@protonmail.com/lua/fmtCheck.cue +++ b/pkg/universe.dagger.io/x/teddylear@protonmail.com/lua/fmtCheck.cue @@ -7,13 +7,13 @@ import ( // Checks lua format via Stylua #StyluaCheck: { - // Files to Copy - source: dagger.#FS + // Files to Copy + source: dagger.#FS - // Any extra formatting args - extraArgs: [...string] + // Any extra formatting args + extraArgs: [...string] - _run: docker.#Build & { + _run: docker.#Build & { steps: [ docker.#Pull & { source: "rust:latest" diff --git a/pkg/universe.dagger.io/x/teddylear@protonmail.com/lua/test/fmtCheck.cue b/pkg/universe.dagger.io/x/teddylear@protonmail.com/lua/test/fmtCheck.cue index f9fe7774..53e673a2 100644 --- a/pkg/universe.dagger.io/x/teddylear@protonmail.com/lua/test/fmtCheck.cue +++ b/pkg/universe.dagger.io/x/teddylear@protonmail.com/lua/test/fmtCheck.cue @@ -8,12 +8,7 @@ import ( dagger.#Plan & { client: filesystem: "./data/hello": read: contents: dagger.#FS - actions: test: { - simple: { - fmtCheck: lua.#StyluaCheck & { - source: client.filesystem."./data/hello".read.contents - } - } + actions: test: simple: fmtCheck: lua.#StyluaCheck & { + source: client.filesystem."./data/hello".read.contents } } - diff --git a/tests/plan/client/env/default.cue b/tests/plan/client/env/default.cue index 93800148..7cfdd552 100644 --- a/tests/plan/client/env/default.cue +++ b/tests/plan/client/env/default.cue @@ -12,8 +12,8 @@ dagger.#Plan & { source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3" } test: core.#Exec & { - input: image.output - args: ["test", client.env.TEST_DEFAULT, "=", "hello universe"] + input: image.output + args: ["test", client.env.TEST_DEFAULT, "=", "hello universe"] } } } diff --git a/tests/plan/client/env/usage.cue b/tests/plan/client/env/usage.cue index 72ebac2a..f3a2e841 100644 --- a/tests/plan/client/env/usage.cue +++ b/tests/plan/client/env/usage.cue @@ -7,8 +7,8 @@ import ( dagger.#Plan & { client: env: { - TEST_STRING: string - TEST_SECRET: dagger.#Secret + TEST_STRING: string + TEST_SECRET: dagger.#Secret TEST_DEFAULT: string | *"hello world" } actions: {