-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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 <jonathan.sternberg@docker.com>
- Loading branch information
1 parent
6acf12f
commit 18a8384
Showing
20 changed files
with
137 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
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" "brimstone@the.narro.ws") | ||
(env "GOPATH" "/go") | ||
(label "maintainer" "brimstone@the.narro.ws" "") | ||
(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
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" "foo@bar.com") | ||
(env "GOPATH" "\\go") | ||
(label "maintainer" "foo@bar.com" "") | ||
(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" "foo@bar.com") | ||
(env "GOPATH" "\\go") | ||
(label "maintainer" "foo@bar.com" "") | ||
(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" "foo@bar.com") | ||
(env "GOPATH" "\\go") | ||
(label "maintainer" "foo@bar.com" "") | ||
(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
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
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
Oops, something went wrong.