This commit is contained in:
CrazyMax 2025-05-23 15:11:04 +02:00 committed by GitHub
commit 3d694b93ce
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 28 additions and 0 deletions

View File

@ -73,6 +73,13 @@ target "lint-gopls" {
target = "gopls-analyze"
}
target "modernize-fix" {
inherits = ["_common"]
dockerfile = "./hack/dockerfiles/lint.Dockerfile"
target = "modernize-fix"
output = ["."]
}
target "validate-vendor" {
inherits = ["_common"]
dockerfile = "./hack/dockerfiles/vendor.Dockerfile"

View File

@ -91,4 +91,25 @@ RUN --mount=target=. \
done
EOF
FROM base AS modernize-fix-run
COPY --link --from=xx / /
ARG TARGETNAME
ARG TARGETPLATFORM
WORKDIR /go/src/github.com/docker/buildx
RUN --mount=target=.,rw \
--mount=target=/root/.cache,type=cache,id=lint-cache-${TARGETNAME}-${TARGETPLATFORM} \
--mount=target=/gopls-analyzers,from=gopls,source=/out <<EOF
set -ex
xx-go --wrap
mkdir /out
/gopls-analyzers/modernize -fix ./...
for file in $(git status --porcelain | awk '/^ M/ {print $2}'); do
mkdir -p /out/$(dirname $file)
cp $file /out/$file
done
EOF
FROM scratch AS modernize-fix
COPY --link --from=modernize-fix-run /out /
FROM lint