-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
42 lines (27 loc) · 1.21 KB
/
Makefile
File metadata and controls
42 lines (27 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
BINARY := fm
.PHONY: all build binary test lint test-cli test-cli-live test-all test-ci cover vet fmt clean help
all: build ## Build the binary (default)
build: test binary ## Run unit tests and build the binary
binary: ## Build the binary
go build -o $(BINARY) .
test: ## Run unit tests
go test ./...
lint: ## Run golangci-lint
golangci-lint run ./...
test-cli: binary ## Run scrut CLI integration tests
scrut test tests/errors.md tests/flags.md tests/arguments.md tests/help.md tests/sieve.md
test-cli-live: binary ## Run opt-in live CLI integration tests (requires FM_CREDENTIAL_COMMAND and FM_LIVE_TESTS=1)
scrut test tests/live.md
test-all: test test-cli ## Run all tests (unit + CLI)
test-ci: vet fmt lint test-all ## Run CI test suite
cover: ## Run unit tests with coverage
go test -coverprofile=coverage.out ./...
go tool cover -func=coverage.out
vet: ## Run go vet
go vet ./...
fmt: ## Check formatting (exits non-zero if files need formatting)
@test -z "$$(gofmt -l .)" || { gofmt -l . && exit 1; }
clean: ## Remove build artifacts
rm -f $(BINARY) coverage.out
help: ## Show this help
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " %-12s %s\n", $$1, $$2}'