diff --git a/Makefile b/Makefile index 1ce9b8f5f..3b340ddbb 100644 --- a/Makefile +++ b/Makefile @@ -90,10 +90,17 @@ bootstrap: ## Download and install all go dependencies (+ prep tooling in the ./ .PHONY: lint lint: ## Run gofmt + golangci lint checks $(call title,Running linters) + # ensure there are no go fmt differences @printf "files with gofmt issues: [$(shell gofmt -l -s .)]\n" @test -z "$(shell gofmt -l -s .)" + + # run all golangci-lint rules $(LINTCMD) + # go tooling does not play well with certain filename characters, ensure the common cases don't result in future "go get" failures + $(eval MALFORMED_FILENAMES := $(shell find . | grep -e ':')) + @bash -c "[[ '$(MALFORMED_FILENAMES)' == '' ]] || (printf '\nfound unsupported filename characters:\n$(MALFORMED_FILENAMES)\n\n' && false)" + .PHONY: lint-fix lint-fix: ## Auto-format all source code + run golangci lint fixers $(call title,Running lint fixers) diff --git a/test/acceptance/deb.sh b/test/acceptance/deb.sh index f73b45b38..ef540f4e9 100755 --- a/test/acceptance/deb.sh +++ b/test/acceptance/deb.sh @@ -7,8 +7,9 @@ TEST_IMAGE=$3 TEST_TYPE=deb WORK_DIR=`mktemp -d -t "imgbom-acceptance-test-${TEST_TYPE}-XXXXXX"` -REPORT=${WORK_DIR}/acceptance-${TEST_TYPE}-${TEST_IMAGE}.json -GOLDEN_REPORT=${ACC_DIR}/test-fixtures/acceptance-${TEST_IMAGE}.json +NORMAL_TEST_IMAGE=$(echo ${TEST_IMAGE} | tr ':' '-' ) +REPORT=${WORK_DIR}/acceptance-${TEST_TYPE}-${NORMAL_TEST_IMAGE}.json +GOLDEN_REPORT=${ACC_DIR}/test-fixtures/acceptance-${NORMAL_TEST_IMAGE}.json # check if tmp dir was created if [[ ! "${WORK_DIR}" || ! -d "${WORK_DIR}" ]]; then diff --git a/test/acceptance/mac.sh b/test/acceptance/mac.sh index ea0d52cd3..111dcc313 100755 --- a/test/acceptance/mac.sh +++ b/test/acceptance/mac.sh @@ -8,8 +8,9 @@ TEST_IMAGE=$3 TEST_IMAGE_TAR=/tmp/image.tar TEST_TYPE=mac WORK_DIR=`mktemp -d -t "imgbom-acceptance-test-${TEST_TYPE}-XXXXXX"` -REPORT=${WORK_DIR}/acceptance-${TEST_TYPE}-${TEST_IMAGE}.json -GOLDEN_REPORT=${ACC_DIR}/test-fixtures/acceptance-${TEST_IMAGE}.json +NORMAL_TEST_IMAGE=$(echo ${TEST_IMAGE} | tr ':' '-' ) +REPORT=${WORK_DIR}/acceptance-${TEST_TYPE}-${NORMAL_TEST_IMAGE}.json +GOLDEN_REPORT=${ACC_DIR}/test-fixtures/acceptance-${NORMAL_TEST_IMAGE}.json # check if tmp dir was created if [[ ! "${WORK_DIR}" || ! -d "${WORK_DIR}" ]]; then diff --git a/test/acceptance/rpm.sh b/test/acceptance/rpm.sh index 5c9e39034..ee74141f6 100755 --- a/test/acceptance/rpm.sh +++ b/test/acceptance/rpm.sh @@ -7,8 +7,9 @@ TEST_IMAGE=$3 TEST_TYPE=rpm WORK_DIR=`mktemp -d -t "imgbom-acceptance-test-${TEST_TYPE}-XXXXXX"` -REPORT=${WORK_DIR}/acceptance-${TEST_TYPE}-${TEST_IMAGE}.json -GOLDEN_REPORT=${ACC_DIR}/test-fixtures/acceptance-${TEST_IMAGE}.json +NORMAL_TEST_IMAGE=$(echo ${TEST_IMAGE} | tr ':' '-' ) +REPORT=${WORK_DIR}/acceptance-${TEST_TYPE}-${NORMAL_TEST_IMAGE}.json +GOLDEN_REPORT=${ACC_DIR}/test-fixtures/acceptance-${NORMAL_TEST_IMAGE}.json # check if tmp dir was created if [[ ! "${WORK_DIR}" || ! -d "${WORK_DIR}" ]]; then diff --git a/test/acceptance/test-fixtures/acceptance-centos:8.2.2004.json b/test/acceptance/test-fixtures/acceptance-centos-8.2.2004.json similarity index 100% rename from test/acceptance/test-fixtures/acceptance-centos:8.2.2004.json rename to test/acceptance/test-fixtures/acceptance-centos-8.2.2004.json