mirror of https://github.com/docker/compose.git
Lint packages behind feature flag : local, e2e
Signed-off-by: Guillaume Tardif <guillaume.tardif@docker.com>
This commit is contained in:
parent
181b47fcb5
commit
3940b98da5
|
@ -43,11 +43,13 @@ FROM golangci/golangci-lint:${GOLANGCI_LINT_VERSION} AS lint-base
|
||||||
FROM base AS lint
|
FROM base AS lint
|
||||||
ENV CGO_ENABLED=0
|
ENV CGO_ENABLED=0
|
||||||
COPY --from=lint-base /usr/bin/golangci-lint /usr/bin/golangci-lint
|
COPY --from=lint-base /usr/bin/golangci-lint /usr/bin/golangci-lint
|
||||||
|
ARG BUILD_TAGS
|
||||||
ARG GIT_TAG
|
ARG GIT_TAG
|
||||||
RUN --mount=target=. \
|
RUN --mount=target=. \
|
||||||
--mount=type=cache,target=/go/pkg/mod \
|
--mount=type=cache,target=/go/pkg/mod \
|
||||||
--mount=type=cache,target=/root/.cache/go-build \
|
--mount=type=cache,target=/root/.cache/go-build \
|
||||||
--mount=type=cache,target=/root/.cache/golangci-lint \
|
--mount=type=cache,target=/root/.cache/golangci-lint \
|
||||||
|
BUILD_TAGS=${BUILD_TAGS} \
|
||||||
GIT_TAG=${GIT_TAG} \
|
GIT_TAG=${GIT_TAG} \
|
||||||
make -f builder.Makefile lint
|
make -f builder.Makefile lint
|
||||||
|
|
||||||
|
|
1
Makefile
1
Makefile
|
@ -72,6 +72,7 @@ cache-clear: ## Clear the builder cache
|
||||||
|
|
||||||
lint: ## run linter(s)
|
lint: ## run linter(s)
|
||||||
@docker build . \
|
@docker build . \
|
||||||
|
--build-arg BUILD_TAGS=example,local,e2e \
|
||||||
--build-arg GIT_TAG=$(GIT_TAG) \
|
--build-arg GIT_TAG=$(GIT_TAG) \
|
||||||
--target lint
|
--target lint
|
||||||
|
|
||||||
|
|
|
@ -39,6 +39,7 @@ WORK_DIR:=$(shell mktemp -d)
|
||||||
TAGS:=
|
TAGS:=
|
||||||
ifdef BUILD_TAGS
|
ifdef BUILD_TAGS
|
||||||
TAGS=-tags $(BUILD_TAGS)
|
TAGS=-tags $(BUILD_TAGS)
|
||||||
|
LINT_TAGS=--build-tags $(BUILD_TAGS)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
TAR_TRANSFORM:=--transform s/packaging/docker/ --transform s/bin/docker/ --transform s/docker-linux-amd64/docker/ --transform s/docker-darwin-amd64/docker/
|
TAR_TRANSFORM:=--transform s/packaging/docker/ --transform s/bin/docker/ --transform s/docker-linux-amd64/docker/ --transform s/docker-darwin-amd64/docker/
|
||||||
|
@ -68,7 +69,7 @@ test:
|
||||||
|
|
||||||
.PHONY: lint
|
.PHONY: lint
|
||||||
lint:
|
lint:
|
||||||
golangci-lint run --timeout 10m0s ./...
|
golangci-lint run $(LINT_TAGS) --timeout 10m0s ./...
|
||||||
|
|
||||||
.PHONY: import-restrictions
|
.PHONY: import-restrictions
|
||||||
import-restrictions:
|
import-restrictions:
|
||||||
|
|
Loading…
Reference in New Issue