зеркало из https://github.com/docker/compose-cli.git
Lint packages behind feature flag : local, e2e
Signed-off-by: Guillaume Tardif <guillaume.tardif@docker.com>
This commit is contained in:
Родитель
181b47fcb5
Коммит
3940b98da5
|
@ -43,11 +43,13 @@ FROM golangci/golangci-lint:${GOLANGCI_LINT_VERSION} AS lint-base
|
|||
FROM base AS lint
|
||||
ENV CGO_ENABLED=0
|
||||
COPY --from=lint-base /usr/bin/golangci-lint /usr/bin/golangci-lint
|
||||
ARG BUILD_TAGS
|
||||
ARG GIT_TAG
|
||||
RUN --mount=target=. \
|
||||
--mount=type=cache,target=/go/pkg/mod \
|
||||
--mount=type=cache,target=/root/.cache/go-build \
|
||||
--mount=type=cache,target=/root/.cache/golangci-lint \
|
||||
BUILD_TAGS=${BUILD_TAGS} \
|
||||
GIT_TAG=${GIT_TAG} \
|
||||
make -f builder.Makefile lint
|
||||
|
||||
|
|
1
Makefile
1
Makefile
|
@ -72,6 +72,7 @@ cache-clear: ## Clear the builder cache
|
|||
|
||||
lint: ## run linter(s)
|
||||
@docker build . \
|
||||
--build-arg BUILD_TAGS=example,local,e2e \
|
||||
--build-arg GIT_TAG=$(GIT_TAG) \
|
||||
--target lint
|
||||
|
||||
|
|
|
@ -39,6 +39,7 @@ WORK_DIR:=$(shell mktemp -d)
|
|||
TAGS:=
|
||||
ifdef BUILD_TAGS
|
||||
TAGS=-tags $(BUILD_TAGS)
|
||||
LINT_TAGS=--build-tags $(BUILD_TAGS)
|
||||
endif
|
||||
|
||||
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
|
||||
lint:
|
||||
golangci-lint run --timeout 10m0s ./...
|
||||
golangci-lint run $(LINT_TAGS) --timeout 10m0s ./...
|
||||
|
||||
.PHONY: import-restrictions
|
||||
import-restrictions:
|
||||
|
|
Загрузка…
Ссылка в новой задаче