File tree Expand file tree Collapse file tree 2 files changed +28
-0
lines changed
Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -73,6 +73,13 @@ target "lint-gopls" {
7373 target = " gopls-analyze"
7474}
7575
76+ target "modernize-fix" {
77+ inherits = [" _common" ]
78+ dockerfile = " ./hack/dockerfiles/lint.Dockerfile"
79+ target = " modernize-fix"
80+ output = [" ." ]
81+ }
82+
7683target "validate-vendor" {
7784 inherits = [" _common" ]
7885 dockerfile = " ./hack/dockerfiles/vendor.Dockerfile"
Original file line number Diff line number Diff line change @@ -91,4 +91,25 @@ RUN --mount=target=. \
9191 done
9292EOF
9393
94+ FROM base AS modernize-fix-run
95+ COPY --link --from=xx / /
96+ ARG TARGETNAME
97+ ARG TARGETPLATFORM
98+ WORKDIR /go/src/github.com/docker/buildx
99+ RUN --mount=target=.,rw \
100+ --mount=target=/root/.cache,type=cache,id=lint-cache-${TARGETNAME}-${TARGETPLATFORM} \
101+ --mount=target=/gopls-analyzers,from=gopls,source=/out <<EOF
102+ set -ex
103+ xx-go --wrap
104+ mkdir /out
105+ /gopls-analyzers/modernize -fix ./...
106+ for file in $(git status --porcelain | awk '/^ M/ {print $2}' ); do
107+ mkdir -p /out/$(dirname $file)
108+ cp $file /out/$file
109+ done
110+ EOF
111+
112+ FROM scratch AS modernize-fix
113+ COPY --link --from=modernize-fix-run /out /
114+
94115FROM lint
You can’t perform that action at this time.
0 commit comments