From 3d7951de089f60cd6c2a92c29344ff4779ae1c29 Mon Sep 17 00:00:00 2001 From: kpango Date: Thu, 14 Nov 2024 16:20:59 +0900 Subject: [PATCH] refactor dockerfiles and update gitattributes Signed-off-by: kpango --- .gitattributes | 50 ++++++++++++++++++- dockers/agent/core/agent/Dockerfile | 3 +- dockers/agent/core/faiss/Dockerfile | 3 +- dockers/agent/core/ngt/Dockerfile | 3 +- dockers/agent/sidecar/Dockerfile | 3 +- dockers/binfmt/Dockerfile | 3 +- dockers/buildbase/Dockerfile | 3 +- dockers/buildkit/Dockerfile | 3 +- dockers/buildkit/syft/scanner/Dockerfile | 3 +- dockers/ci/base/Dockerfile | 3 +- dockers/dev/Dockerfile | 3 +- dockers/discoverer/k8s/Dockerfile | 3 +- dockers/example/client/Dockerfile | 3 +- dockers/gateway/filter/Dockerfile | 3 +- dockers/gateway/lb/Dockerfile | 3 +- dockers/gateway/mirror/Dockerfile | 3 +- dockers/index/job/correction/Dockerfile | 3 +- dockers/index/job/creation/Dockerfile | 3 +- dockers/index/job/deletion/Dockerfile | 3 +- .../index/job/readreplica/rotate/Dockerfile | 3 +- dockers/index/job/save/Dockerfile | 3 +- dockers/index/operator/Dockerfile | 3 +- dockers/manager/index/Dockerfile | 3 +- dockers/operator/helm/Dockerfile | 3 +- dockers/tools/benchmark/job/Dockerfile | 3 +- dockers/tools/benchmark/operator/Dockerfile | 3 +- dockers/tools/cli/loadtest/Dockerfile | 3 +- hack/docker/gen/main.go | 1 + hack/git/hooks/pre-commit | 1 + 29 files changed, 102 insertions(+), 28 deletions(-) diff --git a/.gitattributes b/.gitattributes index 70c4108900..c8f1be9c9f 100644 --- a/.gitattributes +++ b/.gitattributes @@ -13,6 +13,52 @@ # See the License for the specific language governing permissions and # limitations under the License. # +* text encoding=utf-8 eol=lf=auto eol=lf -# https://github.com/github/linguist/blob/master/docs/overrides.md -.all-contributorsrc linguist-language=JSON +*.config text encoding=utf-8 eol=lf +*.cpp text encoding=utf-8 eol=lf diff=cpp +*.css text encoding=utf-8 eol=lf +*.csv text encoding=utf-8 eol=lf linguist-language=CSV +*.go text encoding=utf-8 eol=lf diff=go +*.h text encoding=utf-8 eol=lf diff=cpp +*.hpp text encoding=utf-8 eol=lf diff=cpp +*.json text encoding=utf-8 eol=lf diff=json linguist-language=JSON +*.md text encoding=utf-8 eol=lf +*.proto text encoding=utf-8 eol=lf diff=proto +*.py text encoding=utf-8 eol=lf diff=python +*.rs text encoding=utf-8 eol=lf diff=rust +*.txt text encoding=utf-8 eol=lf +*.xml text encoding=utf-8 eol=lf diff=html +*.yaml text encoding=utf-8 eol=lf +*.yml text encoding=utf-8 eol=lf +.all-contributorsrc text encoding=utf-8 eol=lf linguist-language=JSON +Dockerfile text encoding=utf-8 eol=lf +LICENSE text encoding=utf-8 eol=lf + + +*.a binary +*.gz binary +*.jpeg binary +*.o binary +*.pdf binary +*.so binary +*.zip binary +*.jpg binary filter=lfs diff=lfs merge=lfs -text +*.png binary filter=lfs diff=lfs merge=lfs -text +*.ai binary filter=lfs diff=lfs merge=lfs -text +*.psd binary filter=lfs diff=lfs merge=lfs -text + +*.json merge=ours +*.mod merge=ours +*.sum merge=ours +*.svg merge=ours + + +vendor/** linguist-vendored + +*.tmp export-ignore +*.tmp.* export-ignore +*~ export-ignore +.DS_Store export-ignore +.~lock.* export-ignore +Thumbs.db export-ignore diff --git a/dockers/agent/core/agent/Dockerfile b/dockers/agent/core/agent/Dockerfile index 5c39dcda13..5e7c381590 100644 --- a/dockers/agent/core/agent/Dockerfile +++ b/dockers/agent/core/agent/Dockerfile @@ -1,4 +1,5 @@ # syntax = docker/dockerfile:latest +# check=error=true # # Copyright (C) 2019-2024 vdaas.org vald team # @@ -93,4 +94,4 @@ LABEL maintainer="vdaas.org vald team " COPY --from=builder /usr/bin/agent /usr/bin/agent # skipcq: DOK-DL3002 USER nonroot:nonroot -ENTRYPOINT ["/usr/bin/agent"] +ENTRYPOINT ["/usr/bin/agent"] \ No newline at end of file diff --git a/dockers/agent/core/faiss/Dockerfile b/dockers/agent/core/faiss/Dockerfile index f466a02fec..644e951f29 100644 --- a/dockers/agent/core/faiss/Dockerfile +++ b/dockers/agent/core/faiss/Dockerfile @@ -1,4 +1,5 @@ # syntax = docker/dockerfile:latest +# check=error=true # # Copyright (C) 2019-2024 vdaas.org vald team # @@ -95,4 +96,4 @@ COPY --from=builder /usr/bin/faiss /usr/bin/faiss COPY cmd/agent/core/faiss/sample.yaml /etc/server/config.yaml # skipcq: DOK-DL3002 USER nonroot:nonroot -ENTRYPOINT ["/usr/bin/faiss"] +ENTRYPOINT ["/usr/bin/faiss"] \ No newline at end of file diff --git a/dockers/agent/core/ngt/Dockerfile b/dockers/agent/core/ngt/Dockerfile index 076dc3b695..32a256cdc3 100644 --- a/dockers/agent/core/ngt/Dockerfile +++ b/dockers/agent/core/ngt/Dockerfile @@ -1,4 +1,5 @@ # syntax = docker/dockerfile:latest +# check=error=true # # Copyright (C) 2019-2024 vdaas.org vald team # @@ -94,4 +95,4 @@ COPY --from=builder /usr/bin/ngt /usr/bin/ngt COPY cmd/agent/core/ngt/sample.yaml /etc/server/config.yaml # skipcq: DOK-DL3002 USER nonroot:nonroot -ENTRYPOINT ["/usr/bin/ngt"] +ENTRYPOINT ["/usr/bin/ngt"] \ No newline at end of file diff --git a/dockers/agent/sidecar/Dockerfile b/dockers/agent/sidecar/Dockerfile index b4a1d5ed90..29515468f3 100644 --- a/dockers/agent/sidecar/Dockerfile +++ b/dockers/agent/sidecar/Dockerfile @@ -1,4 +1,5 @@ # syntax = docker/dockerfile:latest +# check=error=true # # Copyright (C) 2019-2024 vdaas.org vald team # @@ -84,4 +85,4 @@ LABEL maintainer="vdaas.org vald team " COPY --from=builder /usr/bin/sidecar /usr/bin/sidecar # skipcq: DOK-DL3002 USER nonroot:nonroot -ENTRYPOINT ["/usr/bin/sidecar"] +ENTRYPOINT ["/usr/bin/sidecar"] \ No newline at end of file diff --git a/dockers/binfmt/Dockerfile b/dockers/binfmt/Dockerfile index f2d73909bd..48882b845f 100644 --- a/dockers/binfmt/Dockerfile +++ b/dockers/binfmt/Dockerfile @@ -1,4 +1,5 @@ # syntax = docker/dockerfile:latest +# check=error=true # # Copyright (C) 2019-2024 vdaas.org vald team # @@ -16,4 +17,4 @@ # # DO_NOT_EDIT this Dockerfile is generated by https://github.com/vdaas/vald/blob/main/hack/docker/gen/main.go -FROM tonistiigi/binfmt:master AS builder +FROM tonistiigi/binfmt:master AS builder \ No newline at end of file diff --git a/dockers/buildbase/Dockerfile b/dockers/buildbase/Dockerfile index 301a31e010..080a6461de 100644 --- a/dockers/buildbase/Dockerfile +++ b/dockers/buildbase/Dockerfile @@ -1,4 +1,5 @@ # syntax = docker/dockerfile:latest +# check=error=true # # Copyright (C) 2019-2024 vdaas.org vald team # @@ -16,4 +17,4 @@ # # DO_NOT_EDIT this Dockerfile is generated by https://github.com/vdaas/vald/blob/main/hack/docker/gen/main.go -FROM ubuntu:devel AS builder +FROM ubuntu:devel AS builder \ No newline at end of file diff --git a/dockers/buildkit/Dockerfile b/dockers/buildkit/Dockerfile index 99c71c61e2..1acaffa2ed 100644 --- a/dockers/buildkit/Dockerfile +++ b/dockers/buildkit/Dockerfile @@ -1,4 +1,5 @@ # syntax = docker/dockerfile:latest +# check=error=true # # Copyright (C) 2019-2024 vdaas.org vald team # @@ -16,4 +17,4 @@ # # DO_NOT_EDIT this Dockerfile is generated by https://github.com/vdaas/vald/blob/main/hack/docker/gen/main.go -FROM moby/buildkit:master AS builder +FROM moby/buildkit:master AS builder \ No newline at end of file diff --git a/dockers/buildkit/syft/scanner/Dockerfile b/dockers/buildkit/syft/scanner/Dockerfile index 4a23207c47..5857575499 100644 --- a/dockers/buildkit/syft/scanner/Dockerfile +++ b/dockers/buildkit/syft/scanner/Dockerfile @@ -1,4 +1,5 @@ # syntax = docker/dockerfile:latest +# check=error=true # # Copyright (C) 2019-2024 vdaas.org vald team # @@ -16,4 +17,4 @@ # # DO_NOT_EDIT this Dockerfile is generated by https://github.com/vdaas/vald/blob/main/hack/docker/gen/main.go -FROM docker/buildkit-syft-scanner:edge AS scanner +FROM docker/buildkit-syft-scanner:edge AS scanner \ No newline at end of file diff --git a/dockers/ci/base/Dockerfile b/dockers/ci/base/Dockerfile index 2b39d02e0a..2b1b8f4b4d 100644 --- a/dockers/ci/base/Dockerfile +++ b/dockers/ci/base/Dockerfile @@ -1,4 +1,5 @@ # syntax = docker/dockerfile:latest +# check=error=true # # Copyright (C) 2019-2024 vdaas.org vald team # @@ -127,4 +128,4 @@ RUN --mount=type=bind,target=.,rw \ && rm -rf ${GOPATH}/src/github.com/${ORG}/${REPO}/* # skipcq: DOK-DL3002 USER root:root -ENTRYPOINT ["/bin/bash"] +ENTRYPOINT ["/bin/bash"] \ No newline at end of file diff --git a/dockers/dev/Dockerfile b/dockers/dev/Dockerfile index 0e0996b5e7..8e61976a78 100644 --- a/dockers/dev/Dockerfile +++ b/dockers/dev/Dockerfile @@ -1,4 +1,5 @@ # syntax = docker/dockerfile:latest +# check=error=true # # Copyright (C) 2019-2024 vdaas.org vald team # @@ -145,4 +146,4 @@ RUN --mount=type=bind,target=.,rw \ && make faiss/install \ && rm -rf ${GOPATH}/src/github.com/${ORG}/${REPO}/* # skipcq: DOK-DL3002 -USER root:root +USER root:root \ No newline at end of file diff --git a/dockers/discoverer/k8s/Dockerfile b/dockers/discoverer/k8s/Dockerfile index a9bf1e5781..e36c199468 100644 --- a/dockers/discoverer/k8s/Dockerfile +++ b/dockers/discoverer/k8s/Dockerfile @@ -1,4 +1,5 @@ # syntax = docker/dockerfile:latest +# check=error=true # # Copyright (C) 2019-2024 vdaas.org vald team # @@ -85,4 +86,4 @@ COPY --from=builder /usr/bin/discoverer /usr/bin/discoverer COPY cmd/discoverer/k8s/sample.yaml /etc/server/config.yaml # skipcq: DOK-DL3002 USER nonroot:nonroot -ENTRYPOINT ["/usr/bin/discoverer"] +ENTRYPOINT ["/usr/bin/discoverer"] \ No newline at end of file diff --git a/dockers/example/client/Dockerfile b/dockers/example/client/Dockerfile index 37a504a75d..d5ee1c9c76 100644 --- a/dockers/example/client/Dockerfile +++ b/dockers/example/client/Dockerfile @@ -1,4 +1,5 @@ # syntax = docker/dockerfile:latest +# check=error=true # # Copyright (C) 2019-2024 vdaas.org vald team # @@ -92,4 +93,4 @@ LABEL maintainer="vdaas.org vald team " COPY --from=builder /usr/bin/client /usr/bin/client # skipcq: DOK-DL3002 USER nonroot:nonroot -ENTRYPOINT ["/usr/bin/client"] +ENTRYPOINT ["/usr/bin/client"] \ No newline at end of file diff --git a/dockers/gateway/filter/Dockerfile b/dockers/gateway/filter/Dockerfile index 4ddc9858e9..f06d71d908 100644 --- a/dockers/gateway/filter/Dockerfile +++ b/dockers/gateway/filter/Dockerfile @@ -1,4 +1,5 @@ # syntax = docker/dockerfile:latest +# check=error=true # # Copyright (C) 2019-2024 vdaas.org vald team # @@ -85,4 +86,4 @@ COPY --from=builder /usr/bin/filter /usr/bin/filter COPY cmd/gateway/filter/sample.yaml /etc/server/config.yaml # skipcq: DOK-DL3002 USER nonroot:nonroot -ENTRYPOINT ["/usr/bin/filter"] +ENTRYPOINT ["/usr/bin/filter"] \ No newline at end of file diff --git a/dockers/gateway/lb/Dockerfile b/dockers/gateway/lb/Dockerfile index c3bd773deb..2c5bde8ca6 100644 --- a/dockers/gateway/lb/Dockerfile +++ b/dockers/gateway/lb/Dockerfile @@ -1,4 +1,5 @@ # syntax = docker/dockerfile:latest +# check=error=true # # Copyright (C) 2019-2024 vdaas.org vald team # @@ -85,4 +86,4 @@ COPY --from=builder /usr/bin/lb /usr/bin/lb COPY cmd/gateway/lb/sample.yaml /etc/server/config.yaml # skipcq: DOK-DL3002 USER nonroot:nonroot -ENTRYPOINT ["/usr/bin/lb"] +ENTRYPOINT ["/usr/bin/lb"] \ No newline at end of file diff --git a/dockers/gateway/mirror/Dockerfile b/dockers/gateway/mirror/Dockerfile index 693d891601..9726c2786e 100644 --- a/dockers/gateway/mirror/Dockerfile +++ b/dockers/gateway/mirror/Dockerfile @@ -1,4 +1,5 @@ # syntax = docker/dockerfile:latest +# check=error=true # # Copyright (C) 2019-2024 vdaas.org vald team # @@ -85,4 +86,4 @@ COPY --from=builder /usr/bin/mirror /usr/bin/mirror COPY cmd/gateway/mirror/sample.yaml /etc/server/config.yaml # skipcq: DOK-DL3002 USER nonroot:nonroot -ENTRYPOINT ["/usr/bin/mirror"] +ENTRYPOINT ["/usr/bin/mirror"] \ No newline at end of file diff --git a/dockers/index/job/correction/Dockerfile b/dockers/index/job/correction/Dockerfile index 1dbefb3c48..95358d174f 100644 --- a/dockers/index/job/correction/Dockerfile +++ b/dockers/index/job/correction/Dockerfile @@ -1,4 +1,5 @@ # syntax = docker/dockerfile:latest +# check=error=true # # Copyright (C) 2019-2024 vdaas.org vald team # @@ -85,4 +86,4 @@ COPY --from=builder /usr/bin/index-correction /usr/bin/index-correction COPY cmd/index/job/correction/sample.yaml /etc/server/config.yaml # skipcq: DOK-DL3002 USER nonroot:nonroot -ENTRYPOINT ["/usr/bin/index-correction"] +ENTRYPOINT ["/usr/bin/index-correction"] \ No newline at end of file diff --git a/dockers/index/job/creation/Dockerfile b/dockers/index/job/creation/Dockerfile index 13576d6dc6..b6a67bd69d 100644 --- a/dockers/index/job/creation/Dockerfile +++ b/dockers/index/job/creation/Dockerfile @@ -1,4 +1,5 @@ # syntax = docker/dockerfile:latest +# check=error=true # # Copyright (C) 2019-2024 vdaas.org vald team # @@ -85,4 +86,4 @@ COPY --from=builder /usr/bin/index-creation /usr/bin/index-creation COPY cmd/index/job/creation/sample.yaml /etc/server/config.yaml # skipcq: DOK-DL3002 USER nonroot:nonroot -ENTRYPOINT ["/usr/bin/index-creation"] +ENTRYPOINT ["/usr/bin/index-creation"] \ No newline at end of file diff --git a/dockers/index/job/deletion/Dockerfile b/dockers/index/job/deletion/Dockerfile index 6fc33b1d4c..a83def4358 100644 --- a/dockers/index/job/deletion/Dockerfile +++ b/dockers/index/job/deletion/Dockerfile @@ -1,4 +1,5 @@ # syntax = docker/dockerfile:latest +# check=error=true # # Copyright (C) 2019-2024 vdaas.org vald team # @@ -85,4 +86,4 @@ COPY --from=builder /usr/bin/index-deletion /usr/bin/index-deletion COPY cmd/index/job/deletion/sample.yaml /etc/server/config.yaml # skipcq: DOK-DL3002 USER nonroot:nonroot -ENTRYPOINT ["/usr/bin/index-deletion"] +ENTRYPOINT ["/usr/bin/index-deletion"] \ No newline at end of file diff --git a/dockers/index/job/readreplica/rotate/Dockerfile b/dockers/index/job/readreplica/rotate/Dockerfile index d443e0fcc0..078e5ed92e 100644 --- a/dockers/index/job/readreplica/rotate/Dockerfile +++ b/dockers/index/job/readreplica/rotate/Dockerfile @@ -1,4 +1,5 @@ # syntax = docker/dockerfile:latest +# check=error=true # # Copyright (C) 2019-2024 vdaas.org vald team # @@ -85,4 +86,4 @@ COPY --from=builder /usr/bin/readreplica-rotate /usr/bin/readreplica-rotate COPY cmd/index/job/readreplica/rotate/sample.yaml /etc/server/config.yaml # skipcq: DOK-DL3002 USER nonroot:nonroot -ENTRYPOINT ["/usr/bin/readreplica-rotate"] +ENTRYPOINT ["/usr/bin/readreplica-rotate"] \ No newline at end of file diff --git a/dockers/index/job/save/Dockerfile b/dockers/index/job/save/Dockerfile index 9ef2ef629c..5618d20f57 100644 --- a/dockers/index/job/save/Dockerfile +++ b/dockers/index/job/save/Dockerfile @@ -1,4 +1,5 @@ # syntax = docker/dockerfile:latest +# check=error=true # # Copyright (C) 2019-2024 vdaas.org vald team # @@ -85,4 +86,4 @@ COPY --from=builder /usr/bin/index-save /usr/bin/index-save COPY cmd/index/job/save/sample.yaml /etc/server/config.yaml # skipcq: DOK-DL3002 USER nonroot:nonroot -ENTRYPOINT ["/usr/bin/index-save"] +ENTRYPOINT ["/usr/bin/index-save"] \ No newline at end of file diff --git a/dockers/index/operator/Dockerfile b/dockers/index/operator/Dockerfile index d1ff09eec6..d237471030 100644 --- a/dockers/index/operator/Dockerfile +++ b/dockers/index/operator/Dockerfile @@ -1,4 +1,5 @@ # syntax = docker/dockerfile:latest +# check=error=true # # Copyright (C) 2019-2024 vdaas.org vald team # @@ -85,4 +86,4 @@ COPY --from=builder /usr/bin/index-operator /usr/bin/index-operator COPY cmd/index/operator/sample.yaml /etc/server/config.yaml # skipcq: DOK-DL3002 USER nonroot:nonroot -ENTRYPOINT ["/usr/bin/index-operator"] +ENTRYPOINT ["/usr/bin/index-operator"] \ No newline at end of file diff --git a/dockers/manager/index/Dockerfile b/dockers/manager/index/Dockerfile index 2fadc08ebb..730ead5143 100644 --- a/dockers/manager/index/Dockerfile +++ b/dockers/manager/index/Dockerfile @@ -1,4 +1,5 @@ # syntax = docker/dockerfile:latest +# check=error=true # # Copyright (C) 2019-2024 vdaas.org vald team # @@ -85,4 +86,4 @@ COPY --from=builder /usr/bin/index /usr/bin/index COPY cmd/manager/index/sample.yaml /etc/server/config.yaml # skipcq: DOK-DL3002 USER nonroot:nonroot -ENTRYPOINT ["/usr/bin/index"] +ENTRYPOINT ["/usr/bin/index"] \ No newline at end of file diff --git a/dockers/operator/helm/Dockerfile b/dockers/operator/helm/Dockerfile index 049914cba3..341b83bc04 100644 --- a/dockers/operator/helm/Dockerfile +++ b/dockers/operator/helm/Dockerfile @@ -1,4 +1,5 @@ # syntax = docker/dockerfile:latest +# check=error=true # # Copyright (C) 2019-2024 vdaas.org vald team # @@ -106,4 +107,4 @@ COPY --from=builder /opt/helm/charts/vald /opt/helm/charts/vald COPY --from=builder /opt/helm/charts/vald-helm-operator /opt/helm/charts/vald-helm-operator # skipcq: DOK-DL3002 USER nonroot:nonroot -ENTRYPOINT ["/usr/bin/helm-operator", "run", "--watches-file=/opt/helm/watches.yaml"] +ENTRYPOINT ["/usr/bin/helm-operator", "run", "--watches-file=/opt/helm/watches.yaml"] \ No newline at end of file diff --git a/dockers/tools/benchmark/job/Dockerfile b/dockers/tools/benchmark/job/Dockerfile index c4374b6d7b..fd7248165e 100644 --- a/dockers/tools/benchmark/job/Dockerfile +++ b/dockers/tools/benchmark/job/Dockerfile @@ -1,4 +1,5 @@ # syntax = docker/dockerfile:latest +# check=error=true # # Copyright (C) 2019-2024 vdaas.org vald team # @@ -93,4 +94,4 @@ COPY --from=builder /usr/bin/job /usr/bin/job COPY cmd/tools/benchmark/job/sample.yaml /etc/server/config.yaml # skipcq: DOK-DL3002 USER nonroot:nonroot -ENTRYPOINT ["/usr/bin/job"] +ENTRYPOINT ["/usr/bin/job"] \ No newline at end of file diff --git a/dockers/tools/benchmark/operator/Dockerfile b/dockers/tools/benchmark/operator/Dockerfile index f99fa41491..109018e6d6 100644 --- a/dockers/tools/benchmark/operator/Dockerfile +++ b/dockers/tools/benchmark/operator/Dockerfile @@ -1,4 +1,5 @@ # syntax = docker/dockerfile:latest +# check=error=true # # Copyright (C) 2019-2024 vdaas.org vald team # @@ -85,4 +86,4 @@ COPY --from=builder /usr/bin/operator /usr/bin/operator COPY cmd/tools/benchmark/operator/sample.yaml /etc/server/config.yaml # skipcq: DOK-DL3002 USER nonroot:nonroot -ENTRYPOINT ["/usr/bin/operator"] +ENTRYPOINT ["/usr/bin/operator"] \ No newline at end of file diff --git a/dockers/tools/cli/loadtest/Dockerfile b/dockers/tools/cli/loadtest/Dockerfile index c75c5a339d..4647f10b58 100644 --- a/dockers/tools/cli/loadtest/Dockerfile +++ b/dockers/tools/cli/loadtest/Dockerfile @@ -1,4 +1,5 @@ # syntax = docker/dockerfile:latest +# check=error=true # # Copyright (C) 2019-2024 vdaas.org vald team # @@ -93,4 +94,4 @@ COPY --from=builder /usr/bin/loadtest /usr/bin/loadtest COPY cmd/tools/cli/loadtest/sample.yaml /etc/server/config.yaml # skipcq: DOK-DL3002 USER nonroot:nonroot -ENTRYPOINT ["/usr/bin/loadtest"] +ENTRYPOINT ["/usr/bin/loadtest"] \ No newline at end of file diff --git a/hack/docker/gen/main.go b/hack/docker/gen/main.go index 2e3487a779..4af06d51ae 100644 --- a/hack/docker/gen/main.go +++ b/hack/docker/gen/main.go @@ -37,6 +37,7 @@ import ( ) var tmpl = fmt.Sprintf(`# syntax = docker/dockerfile:latest +# check=error=true # # Copyright (C) 2019-{{.Year}} {{.Maintainer}} # diff --git a/hack/git/hooks/pre-commit b/hack/git/hooks/pre-commit index 0405069719..b1e8ed9ccc 100644 --- a/hack/git/hooks/pre-commit +++ b/hack/git/hooks/pre-commit @@ -37,4 +37,5 @@ if git diff HEAD^ --name-only | grep ".go$" > /dev/null; then fi mv -f ${TMPDIR}/go.mod . mv -f ${TMPDIR}/go.sum . + git diff --cached --name-only | xargs -r git add --renormalize fi