Skip to content

Commit

Permalink
fix make help
Browse files Browse the repository at this point in the history
  • Loading branch information
symonk committed Jul 21, 2024
1 parent fc9ef15 commit c1bd92b
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,39 +1,42 @@
MAIN_PACKAGE_PATH := ./cmd/
BINARY_NAME := log-analyse

# ==========
# [Helpers]
# ==========
# ==================================================================================== #
# HELPERS
# ==================================================================================== #

.PHONY: help
help:
@echo 'Usage:''
@sed -n 's/^##//p' ${MAKEFILE_LIST} | column -t -s ':' | sed -e 's/^/ /'
@echo 'Usage:'
@sed -n 's/^##//p' ${MAKEFILE_LIST} | column -t -s ':' | sed -e 's/^/ /'


.PHONY: no-dirty
no-dirty:
git diff --exit-code

# ==========
# [Quality]
# ==========
# ==================================================================================== #
# Quality
# ==================================================================================== #

## tidy: format the code and tidy the mod file
.PHONY: tidy
tidy:
go fmt ./...
go mod tidy -v

## audit: run quality control checks
.PHONY: audit
audit:
go mod verify
go mod vet ./...
go test -race -buildvcs -vet=off ./...

# ==============
# [Development]
# ==============
# ==================================================================================== #
# Development
# ==================================================================================== #

## test: run all tests
.PHONY: test
test:
go test -v -race -buildvcs ./...
Expand All @@ -44,10 +47,12 @@ cover:
go test -v -race -buildvcs -coverprofile=/tmp/coverage.out ./...
go tool cover -html=/tmp/coverage.out

## build: build the binary
.PHONY: build
build:
go build -o=dist/${BINARY_NAME} .

## run: run the built binary (no args)
.PHONY: run
run: build
dist/${BINARY_NAME}
Expand Down

0 comments on commit c1bd92b

Please sign in to comment.