BIN := ipabusedb-docker-reporter

.PHONY: build test lint fmt fmt-check check clean image

build:
	go build -o $(BIN) .

image:
	docker build -t $(BIN) .

test:
	go test ./...

fmt:
	gofmt -w *.go

fmt-check:
	@test -z "$$(gofmt -l .)" || { gofmt -l .; echo "gofmt: files need formatting"; exit 1; }

lint: fmt-check
	go vet ./...

check: lint test build

clean:
	rm -f $(BIN) *.csv
