Browse code

gometalinter: fix --deadline option

1. Add = between the option and the argument, otherwise the argument
appears to be passed on to the linters directly, as in:

> DEBUG: [golint.8]: executing /home/kir/go/bin/golint
> -min_confidence 0.800000 ./10m ./api ./api/errdefs <...>

2. Fix setting the default for GOMETALINTER_OPTS -- the default
was -deadline (rather than --deadline).

Fixes: b96093fa56a9 ("gometalinter: add per-platform configurable options")

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>

Kir Kolyshkin authored on 2018/01/17 07:33:06
Showing 4 changed files
... ...
@@ -190,7 +190,7 @@ RUN ln -s /usr/local/completion/bash/docker /etc/bash_completion.d/docker
190 190
 ENTRYPOINT ["hack/dind"]
191 191
 
192 192
 # Options for hack/validate/gometalinter
193
-ENV GOMETALINTER_OPTS="--deadline 2m"
193
+ENV GOMETALINTER_OPTS="--deadline=2m"
194 194
 
195 195
 # Upload docker source
196 196
 COPY . /go/src/github.com/docker/docker
... ...
@@ -159,7 +159,7 @@ ENV PATH=/usr/local/cli:$PATH
159 159
 ENTRYPOINT ["hack/dind"]
160 160
 
161 161
 # Options for hack/validate/gometalinter
162
-ENV GOMETALINTER_OPTS="--deadline 4m -j2"
162
+ENV GOMETALINTER_OPTS="--deadline=4m -j2"
163 163
 
164 164
 # Upload docker source
165 165
 COPY . /go/src/github.com/docker/docker
... ...
@@ -147,7 +147,7 @@ ENV PATH=/usr/local/cli:$PATH
147 147
 ENTRYPOINT ["hack/dind"]
148 148
 
149 149
 # Options for hack/validate/gometalinter
150
-ENV GOMETALINTER_OPTS="--deadline 10m -j2"
150
+ENV GOMETALINTER_OPTS="--deadline=10m -j2"
151 151
 
152 152
 # Upload docker source
153 153
 COPY . /go/src/github.com/docker/docker
... ...
@@ -6,6 +6,8 @@ SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
6 6
 # CI platforms differ, so per-platform GOMETALINTER_OPTS can be set
7 7
 # from a platform-specific Dockerfile, otherwise let's just set
8 8
 # (somewhat pessimistic) default of 10 minutes.
9
+: ${GOMETALINTER_OPTS=--deadline=10m}
10
+
9 11
 gometalinter \
10
-	${GOMETALINTER_OPTS:--deadine 10m} \
12
+	${GOMETALINTER_OPTS} \
11 13
 	--config $SCRIPTDIR/gometalinter.json ./...