From b1b534992aa9b9e6064e4829d45127ad42ae6659 Mon Sep 17 00:00:00 2001 From: Tony Worm Date: Mon, 15 Mar 2021 08:44:49 -0400 Subject: [PATCH] fix lint errors Signed-off-by: Tony Worm --- stdlib/file/file.cue | 34 +++++++++++++++--------------- tests/stdlib/file/file.cue | 42 ++++++++++++++++++-------------------- 2 files changed, 37 insertions(+), 39 deletions(-) diff --git a/stdlib/file/file.cue b/stdlib/file/file.cue index 05c556f8..8504a4a0 100644 --- a/stdlib/file/file.cue +++ b/stdlib/file/file.cue @@ -6,32 +6,32 @@ import ( ) #Create: { - filename: !="" - permissions: int | *0o644 - contents: string | bytes + filename: !="" + permissions: int | *0o644 + contents: string | bytes #compute: [ - dagger.#WriteFile & { dest: filename, content: contents, mode: permissions} + dagger.#WriteFile & {dest: filename, content: contents, mode: permissions}, ] } #Append: { - filename: !="" - permissions: int | *0o644 - contents: string | bytes - from: dagger.#Artifact + filename: !="" + permissions: int | *0o644 + contents: string | bytes + from: dagger.#Artifact - orig: (#read & { path: filename, "from": from }).data + orig: (#read & {path: filename, "from": from}).data #compute: [ - dagger.#WriteFile & { dest: filename, content: "\(orig)\(contents)", mode: permissions} + dagger.#WriteFile & {dest: filename, content: "\(orig)\(contents)", mode: permissions}, ] } #Read: { filename: !="" - from: dagger.#Artifact - contents: (#read & { path: filename, "from": from }).data + from: dagger.#Artifact + contents: (#read & {path: filename, "from": from}).data } #read: { @@ -40,8 +40,8 @@ import ( data: { string #compute: [ - dagger.#Load & {"from": from}, - dagger.#Export & { source: path } + dagger.#Load & {"from": from}, + dagger.#Export & {source: path}, ] } } @@ -49,8 +49,8 @@ import ( #Glob: { glob: !="" filenames: [...string] - from: dagger.#Artifact - files: (_#glob & { "glob": glob, "from": from }).data + from: dagger.#Artifact + files: (_#glob & {"glob": glob, "from": from}).data // trim suffix because ls always ends with newline filenames: strings.Split(strings.TrimSuffix(files, "\n"), "\n") } @@ -66,7 +66,7 @@ _#glob: { dagger.#Exec & { args: ["sh", "-c", "ls \(glob) > \(_tmppath)"] }, - dagger.#Export & { source: _tmppath } + dagger.#Export & {source: _tmppath}, ] } } diff --git a/tests/stdlib/file/file.cue b/tests/stdlib/file/file.cue index 2358e5ff..6139446b 100644 --- a/tests/stdlib/file/file.cue +++ b/tests/stdlib/file/file.cue @@ -21,8 +21,8 @@ TestCreate: { "sh", "-ec", """ - test "$(cat /file.txt)" = "hello world" - """, + test "$(cat /file.txt)" = "hello world" + """, ] mount: "/file.txt": { from: write @@ -35,7 +35,7 @@ TestCreate: { TestRead: { read: file.#Read & { filename: "/etc/alpine-release" - from: alpine.#Image & { version: "3.10.6" } + from: alpine.#Image & {version: "3.10.6"} } test: #compute: [ dagger.#Load & {from: alpine.#Image}, @@ -60,7 +60,7 @@ TestRead2: { read: file.#Read & { filename: "/file.txt" - from: write + from: write } test: #compute: [ @@ -88,14 +88,14 @@ TestAppend: { append: file.#Append & { filename: "/file.txt" contents: content2 - from: write + from: write } orig: append.orig read: file.#Read & { filename: "/file.txt" - from: append + from: append } new: read.contents @@ -103,20 +103,20 @@ TestAppend: { test: new & "hello worldfoo bar" //test: #compute: [ - //dagger.#Load & {from: alpine.#Image}, - //dagger.#Exec & { - //args: [ - //"sh", - //"-ec", - //""" - //test "$(cat /file.txt)" = "hello worldfoo bar" - //""", - //] - //mount: "/file.txt": { - //from: append - //path: "/file.txt" - //} - //}, + //dagger.#Load & {from: alpine.#Image}, + //dagger.#Exec & { + //args: [ + //"sh", + //"-ec", + //""" + //test "$(cat /file.txt)" = "hello worldfoo bar" + //""", + //] + //mount: "/file.txt": { + //from: append + //path: "/file.txt" + //} + //}, //] } @@ -127,5 +127,3 @@ TestGlob: { } test: list.filenames & ["/etc/resolv.conf"] } - -