Skip to content

Commit

Permalink
🔧 Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
agnesk92 committed Oct 14, 2023
1 parent 26f1964 commit 2daf891
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
makefile := $(firstword $(MAKEFILE_LIST))

##
## 🔨 GENERAL
##

.PHONY: help
help: ## Help.
@echo "Targets:"
@grep -F -h "##" $(makefile) | grep -F -v grep -F | sed -e 's/\\$$//' | sed -e 's/\(.*\):.*##[ \t]*/ \1 ## /' | column -t -s '##'
@echo

.PHONY: install
install: ## Install utilities.
@echo "Installing dependencies..."
@go install golang.org/x/tools/cmd/goimports@latest
@@$(shell curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $$(go env GOPATH)/bin latest)

##
## ✨ TESTING & QUALITY
##

.PHONY: test
test: ## Run unit tests.
@echo "Running tests"
@go test $$(go list ./...)

.PHONY: fmt
fmt: ## Format the code.
@echo "Formatting the code"
@gofmt -s -w .

.PHONY: lint
lint: ## Lint code.
@echo "Linting the code"
@golangci-lint -v --color always run --sort-results ./...

0 comments on commit 2daf891

Please sign in to comment.