File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree 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 @@ -92,4 +92,25 @@ RUN --mount=target=. \
9292 done
9393EOF
9494
95+ FROM base AS modernize-fix-run
96+ COPY --link --from=xx / /
97+ ARG TARGETNAME
98+ ARG TARGETPLATFORM
99+ WORKDIR /go/src/github.com/docker/buildx
100+ RUN --mount=target=.,rw \
101+ --mount=target=/root/.cache,type=cache,id=lint-cache-${TARGETNAME}-${TARGETPLATFORM} \
102+ --mount=target=/gopls-analyzers,from=gopls,source=/out <<EOF
103+ set -ex
104+ xx-go --wrap
105+ mkdir /out
106+ /gopls-analyzers/modernize -fix ./...
107+ for file in $(git status --porcelain | awk '/^ M/ {print $2}' ); do
108+ mkdir -p /out/$(dirname $file)
109+ cp $file /out/$file
110+ done
111+ EOF
112+
113+ FROM scratch AS modernize-fix
114+ COPY --link --from=modernize-fix-run /out /
115+
95116FROM lint
You can’t perform that action at this time.
0 commit comments