forked from moby/buildkit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
linter: lint rule for using the legacy key/value format with whitespace
The `ENV` and `LABEL` commands both support using either a whitespace delimited token or one delimited with the equals token. The equals token is preferred because it is more explicit and less ambiguous than using whitespace. The linter rule emits a warning when it sees the whitespace separator used. To facilitate this, the parser was modified to include the separator as a node in the tree. The associated parsing code has also been changed for 3 arguments instead of only 2 per key/value pair. Signed-off-by: Jonathan A. Sternberg <[email protected]>
- Loading branch information
1 parent
6acf12f
commit 6cfa459
Showing
21 changed files
with
143 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
(from "ubuntu:14.04") | ||
(label "maintainer" "Seongyeol Lim <[email protected]>") | ||
(label "maintainer" "Seongyeol Lim <[email protected]>" "") | ||
(copy "." "/go/src/github.com/docker/docker") | ||
(add "." "/") | ||
(add "null" "/") | ||
|
4 changes: 2 additions & 2 deletions
4
frontend/dockerfile/parser/testfiles/brimstone-consuldock/result
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
(from "brimstone/ubuntu:14.04") | ||
(label "maintainer" "[email protected]") | ||
(env "GOPATH" "/go") | ||
(label "maintainer" "[email protected]" "") | ||
(env "GOPATH" "/go" "") | ||
(entrypoint "/usr/local/bin/consuldock") | ||
(run "apt-get update \t&& dpkg -l | awk '/^ii/ {print $2}' > /tmp/dpkg.clean && apt-get --no-install-recommends install -y git golang ca-certificates && apt-get clean && rm -rf /var/lib/apt/lists \t&& go get -v github.com/brimstone/consuldock && mv $GOPATH/bin/consuldock /usr/local/bin/consuldock \t&& dpkg -l | awk '/^ii/ {print $2}' > /tmp/dpkg.dirty \t&& apt-get remove --purge -y $(diff /tmp/dpkg.clean /tmp/dpkg.dirty | awk '/^>/ {print $2}') \t&& rm /tmp/dpkg.* \t&& rm -rf $GOPATH") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
(from "ubuntu:14.04") | ||
(label "maintainer" "Tianon Gravi <[email protected]> (@tianon)") | ||
(label "maintainer" "Tianon Gravi <[email protected]> (@tianon)" "") | ||
(run "apt-get update && DEBIAN_FRONTEND=noninteractive apt-get --no-install-recommends install -yq \tapt-utils \taufs-tools \tautomake \tbtrfs-tools \tbuild-essential \tcurl \tdpkg-sig \tgit \tiptables \tlibapparmor-dev \tlibcap-dev \tmercurial \tpandoc \tparallel \treprepro \truby1.9.1 \truby1.9.1-dev \ts3cmd=1.1.0* \t--no-install-recommends") | ||
(run "git clone --no-checkout https://git.fedorahosted.org/git/lvm2.git /usr/local/lvm2 && cd /usr/local/lvm2 && git checkout -q v2_02_103") | ||
(run "cd /usr/local/lvm2 && ./configure --enable-static_link && make device-mapper && make install_device-mapper") | ||
(run "curl -sSL https://golang.org/dl/go1.3.src.tar.gz | tar -v -C /usr/local -xz") | ||
(env "PATH" "/usr/local/go/bin:$PATH") | ||
(env "GOPATH" "/go:/go/src/github.com/docker/docker/vendor") | ||
(env "PATH" "/usr/local/go/bin:$PATH" "") | ||
(env "GOPATH" "/go:/go/src/github.com/docker/docker/vendor" "") | ||
(run "cd /usr/local/go/src && ./make.bash --no-clean 2>&1") | ||
(env "DOCKER_CROSSPLATFORMS" "linux/386 linux/arm \tdarwin/amd64 darwin/386 \tfreebsd/amd64 freebsd/386 freebsd/arm") | ||
(env "GOARM" "5") | ||
(env "DOCKER_CROSSPLATFORMS" "linux/386 linux/arm \tdarwin/amd64 darwin/386 \tfreebsd/amd64 freebsd/386 freebsd/arm" "") | ||
(env "GOARM" "5" "") | ||
(run "cd /usr/local/go/src && bash -xc 'for platform in $DOCKER_CROSSPLATFORMS; do GOOS=${platform%/*} GOARCH=${platform##*/} ./make.bash --no-clean 2>&1; done'") | ||
(run "go get golang.org/x/tools/cmd/cover") | ||
(run "gem install --no-rdoc --no-ri fpm --version 1.0.2") | ||
|
@@ -19,6 +19,6 @@ | |
(run "useradd --create-home --gid docker unprivilegeduser") | ||
(volume "/var/lib/docker") | ||
(workdir "/go/src/github.com/docker/docker") | ||
(env "DOCKER_BUILDTAGS" "apparmor selinux") | ||
(env "DOCKER_BUILDTAGS" "apparmor selinux" "") | ||
(entrypoint "hack/dind") | ||
(copy "." "/go/src/github.com/docker/docker") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
(from "ubuntu") | ||
(env "name" "value") | ||
(env "name" "value") | ||
(env "name" "value" "name2" "value2") | ||
(env "name" "\"value value1\"") | ||
(env "name" "value\\ value2") | ||
(env "name" "\"value'quote space'value2\"") | ||
(env "name" "'value\"double quote\"value2'") | ||
(env "name" "value\\ value2" "name2" "value2\\ value3") | ||
(env "name" "\"a\\\"b\"") | ||
(env "name" "\"a\\'b\"") | ||
(env "name" "'a\\'b'") | ||
(env "name" "'a\\'b''") | ||
(env "name" "'a\\\"b'") | ||
(env "name" "\"''\"") | ||
(env "name" "value" "name1" "value1" "name2" "\"value2a value2b\"" "name3" "\"value3a\\n\\\"value3b\\\"\"" "name4" "\"value4a\\\\nvalue4b\"") | ||
(env "name" "value" "") | ||
(env "name" "value" "=") | ||
(env "name" "value" "=" "name2" "value2" "=") | ||
(env "name" "\"value value1\"" "=") | ||
(env "name" "value\\ value2" "=") | ||
(env "name" "\"value'quote space'value2\"" "=") | ||
(env "name" "'value\"double quote\"value2'" "=") | ||
(env "name" "value\\ value2" "=" "name2" "value2\\ value3" "=") | ||
(env "name" "\"a\\\"b\"" "=") | ||
(env "name" "\"a\\'b\"" "=") | ||
(env "name" "'a\\'b'" "=") | ||
(env "name" "'a\\'b''" "=") | ||
(env "name" "'a\\\"b'" "=") | ||
(env "name" "\"''\"" "=") | ||
(env "name" "value" "=" "name1" "value1" "=" "name2" "\"value2a value2b\"" "=" "name3" "\"value3a\\n\\\"value3b\\\"\"" "=" "name4" "\"value4a\\\\nvalue4b\"" "=") |
4 changes: 2 additions & 2 deletions
4
frontend/dockerfile/parser/testfiles/escape-after-comment/result
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
(from "image") | ||
(label "maintainer" "[email protected]") | ||
(env "GOPATH" "\\go") | ||
(label "maintainer" "[email protected]" "") | ||
(env "GOPATH" "\\go" "") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
(from "image") | ||
(label "maintainer" "[email protected]") | ||
(env "GOPATH" "\\go") | ||
(label "maintainer" "[email protected]" "") | ||
(env "GOPATH" "\\go" "") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
(from "image") | ||
(label "maintainer" "[email protected]") | ||
(env "GOPATH" "\\go") | ||
(label "maintainer" "[email protected]" "") | ||
(env "GOPATH" "\\go" "") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
(from "ubuntu:14.04") | ||
(label "maintainer" "Erik \\\\Hollensbe <[email protected]>\\\"") | ||
(label "maintainer" "Erik \\\\Hollensbe <[email protected]>\\\"" "") | ||
(run "apt-get \\update && apt-get \\\"install znc -y") | ||
(add "\\conf\\\\\"" "/.znc") | ||
(run "foo bar baz") | ||
|
4 changes: 2 additions & 2 deletions
4
frontend/dockerfile/parser/testfiles/kartar-entrypoint-oddities/result
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
(from "ubuntu:14.04") | ||
(label "maintainer" "James Turnbull \"[email protected]\"") | ||
(env "REFRESHED_AT" "2014-06-01") | ||
(label "maintainer" "James Turnbull \"[email protected]\"" "") | ||
(env "REFRESHED_AT" "2014-06-01" "") | ||
(run "apt-get update") | ||
(run "apt-get --no-install-recommends install -y redis-server redis-tools") | ||
(expose "6379") | ||
|
Oops, something went wrong.