Skip to content

Commit

Permalink
🔧 #240: Automatically install air (#277)
Browse files Browse the repository at this point in the history
  • Loading branch information
roma-glushko authored Jun 23, 2024
1 parent 08ee414 commit 765f874
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,16 @@ help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'


install-checkers: ## Install static checkers
$(CHECKER_BIN)/.installed: $(CHECKER_BIN)/.installed ## Install static checkers
@echo "🚚 Downloading binaries.."
@GOBIN=$(CHECKER_BIN) go install mvdan.cc/gofumpt@latest
@GOBIN=$(CHECKER_BIN) go install golang.org/x/vuln/cmd/govulncheck@latest
@GOBIN=$(CHECKER_BIN) go install github.com/securego/gosec/v2/cmd/gosec@latest
@GOBIN=$(CHECKER_BIN) go install github.com/swaggo/swag/cmd/swag@latest
@GOBIN=$(CHECKER_BIN) go install github.com/air-verse/air@latest
@touch $(CHECKER_BIN)/.installed

lint: install-checkers ## Lint the source code
lint: $(CHECKER_BIN)/.installed ## Lint the source code
@echo "🧹 Cleaning go.mod.."
@go mod tidy
@echo "🧹 Formatting files.."
Expand All @@ -31,13 +33,13 @@ lint: install-checkers ## Lint the source code
@echo "🧹 GoCI Lint.."
@golangci-lint run ./...

vuln: install-checkers ## Check for vulnerabilities
vuln: $(CHECKER_BIN)/.installed ## Check for vulnerabilities
@echo "🔍 Checking for vulnerabilities"
@#$(CHECKER_BIN)/govulncheck -test ./... enable in https://github.com/EinStack/glide/issues/169
@$(CHECKER_BIN)/gosec -quiet -exclude=G104 ./...

run: ## Run Glide
@air -c .air.toml
run: $(CHECKER_BIN)/.installed ## Run Glide
@$(CHECKER_BIN)/air -c .air.toml

build: ## Build Glide
@echo "🔨Building Glide binary.."
Expand All @@ -47,9 +49,12 @@ build: ## Build Glide
@go build -ldflags $(LDFLAGS_COMMON) -o ./dist/glide;

test: ## Run tests
@go test -v -count=1 -race -shuffle=on -coverprofile=coverage.txt ./...
@go test -v -count=1 -race -shuffle=on -coverprofile=coverage.out ./...

docs-api: install-checkers ## Generate OpenAPI API docs
test-cov: ## Run tests with coverage
@go tool cover -func=coverage.out

docs-api: $(CHECKER_BIN)/.installed ## Generate OpenAPI API docs
@$(CHECKER_BIN)/swag init

telemetry-up: ## Start observability services needed to receive Glides signals
Expand Down

0 comments on commit 765f874

Please sign in to comment.