File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -87,11 +87,13 @@ test-e2e: chainsaw # Run e2e tests against the K8s cluster specified in ~/.kube/
8787 $(CHAINSAW ) test --values ./test/e2e/values.yaml
8888
8989.PHONY : lint
90- lint : golangci-lint.client golangci-lint.controller golangci-lint.sidecar spell-lint # # Run all linters (suggest `make -k`)
90+ lint : golangci-lint.client golangci-lint.controller golangci-lint.sidecar spell-lint dockerfiles-lint # # Run all linters (suggest `make -k`)
9191golangci-lint.% : golangci-lint
9292 cd $* && $(GOLANGCI_LINT ) run $(GOLANGCI_LINT_RUN_OPTS ) --config $(CURDIR ) /.golangci.yaml --new
9393spell-lint :
9494 git ls-files | grep -v -e CHANGELOG -e go.mod -e go.sum -e vendor | xargs $(SPELL_LINT ) -i " Creater,creater,ect" -error -o stderr
95+ dockerfiles-lint :
96+ hack/tools/lint-dockerfiles.sh $(HADOLINT_VERSION )
9597
9698.PHONY : lint-fix
9799lint-fix : golangci-lint-fix.client golangci-lint-fix.controller golangci-lint-fix.sidecar # # Run all linters and perform fixes where possible (suggest `make -k`)
@@ -180,6 +182,7 @@ KIND_VERSION ?= v0.27.0
180182KUSTOMIZE_VERSION ?= v5.6.0
181183MDBOOK_VERSION ?= v0.4.47
182184SPELL_LINT_VERSION ?= v0.6.0
185+ HADOLINT_VERSION ?= v2.12.0
183186
184187.PHONY : chainsaw
185188chainsaw : $(CHAINSAW ) -$(CHAINSAW_VERSION )
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+ set -o errexit
3+ set -o nounset
4+
5+ HADOLINT_VERSION=${1:- latest}
6+
7+ # Exclude vendor dependencies to avoid linting other Dockerfiles and prevent irrelevant warnings
8+ FILES=$( find . -path ' ./vendor' -prune -o -name Dockerfile -print)
9+
10+ for file in $FILES ; do
11+ echo " Linting Dockerfile: ${file} "
12+ ${DOCKER:- docker} run --rm -i ghcr.io/hadolint/hadolint:" ${HADOLINT_VERSION} " hadolint --failure-threshold warning - < " ${file} "
13+ done
You can’t perform that action at this time.
0 commit comments