diff --git a/Makefile b/Makefile index 709c1504..6c31ef9a 100644 --- a/Makefile +++ b/Makefile @@ -84,8 +84,8 @@ help: ## Display this help unit: ## Run tests source ./hack/fetch_ext_bins.sh; fetch_tools; setup_envs; go test -v ./controllers/... ./ipam/... -coverprofile ./cover.out; cd $(APIS_DIR); go test -v ./... -coverprofile ./cover.out -.PHONY: test ## Run formatter, linter and tests -test: generate fmt lint unit +.PHONY: test ## Run linter and tests +test: generate lint unit .PHONY: unit-cover unit-cover: ## Run unit tests with code coverage @@ -147,17 +147,6 @@ lint-full: $(GOLANGCI_LINT) ## Run slower linters to detect possible issues $(GOLANGCI_LINT) run -v --fast=false cd $(APIS_DIR); ../$(GOLANGCI_LINT) run -v --fast=false --timeout=30m -# Run go fmt against code -fmt: - go fmt ./controllers/... ./ipam/... . - cd $(APIS_DIR); go fmt ./... - -# Run go vet against code -vet: - go vet ./controllers/... ./ipam/... . - cd $(APIS_DIR); go vet ./... - - ## -------------------------------------- ## Generate ## -------------------------------------- diff --git a/hack/gofmt.sh b/hack/gofmt.sh deleted file mode 100755 index e811a983..00000000 --- a/hack/gofmt.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh - -set -eux - -IS_CONTAINER="${IS_CONTAINER:-false}" -CONTAINER_RUNTIME="${CONTAINER_RUNTIME:-podman}" - -if [ "${IS_CONTAINER}" != "false" ]; then - export XDG_CACHE_HOME=/tmp/.cache - mkdir /tmp/unit - cp -r ./* /tmp/unit - cd /tmp/unit - make fmt -else - "${CONTAINER_RUNTIME}" run --rm \ - --env IS_CONTAINER=TRUE \ - --volume "${PWD}:/workdir:ro,z" \ - --entrypoint sh \ - --workdir /workdir \ - docker.io/golang:1.21 \ - /workdir/hack/gofmt.sh -fi diff --git a/hack/govet.sh b/hack/govet.sh deleted file mode 100755 index f6f7c583..00000000 --- a/hack/govet.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh - -set -eux - -IS_CONTAINER="${IS_CONTAINER:-false}" -CONTAINER_RUNTIME="${CONTAINER_RUNTIME:-podman}" - -if [ "${IS_CONTAINER}" != "false" ]; then - export XDG_CACHE_HOME=/tmp/.cache - mkdir /tmp/unit - cp -r ./* /tmp/unit - cd /tmp/unit - make vet -else - "${CONTAINER_RUNTIME}" run --rm \ - --env IS_CONTAINER=TRUE \ - --volume "${PWD}:/workdir:ro,z" \ - --entrypoint sh \ - --workdir /workdir \ - docker.io/golang:1.21 \ - /workdir/hack/govet.sh -fi