-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
62 lines (46 loc) · 2.36 KB
/
Makefile
File metadata and controls
62 lines (46 loc) · 2.36 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
.PHONY: test test-unit test-integration test-bench lint lint-fix security coverage build clean help check ci install-tools install-hooks
.DEFAULT_GOAL := help
help: ## Display available commands
@echo "chisel Development Commands"
@echo "==========================="
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-18s\033[0m %s\n", $$1, $$2}'
test: ## Run all tests with race detector
@go test -v -race -tags testing ./... ./golang/... ./markdown/... ./typescript/... ./python/... ./rust/... ./testing/...
test-unit: ## Run unit tests only (short mode)
@go test -v -race -tags testing -short ./... ./golang/... ./markdown/... ./typescript/... ./python/... ./rust/... ./testing/...
test-integration: ## Run integration tests
@go test -v -race -tags testing ./testing/integration/...
test-bench: ## Run benchmarks
@go test -tags testing -bench=. -benchmem -benchtime=1s ./testing/benchmarks/...
lint: ## Run linters
@golangci-lint run --config=.golangci.yml --timeout=5m
lint-fix: ## Run linters with auto-fix
@golangci-lint run --config=.golangci.yml --fix
security: ## Run security scanner
@gosec -quiet ./...
coverage: ## Generate coverage report (HTML)
@go test -tags testing -coverprofile=coverage.out ./... ./golang/... ./markdown/... ./typescript/... ./python/... ./rust/... ./testing/...
@go tool cover -html=coverage.out -o coverage.html
@go tool cover -func=coverage.out | tail -1
@echo "Coverage report: coverage.html"
build: ## Build all packages
@go build ./... ./golang/... ./markdown/... ./typescript/... ./python/... ./rust/... ./testing/...
clean: ## Remove generated files
@rm -f coverage.out coverage.html coverage.txt
@rm -rf dist/
@find . -name "*.test" -delete
@find . -name "*.prof" -delete
@find . -name "*.out" -delete
install-tools: ## Install development tools
@go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.7.2
@go install github.com/securego/gosec/v2/cmd/gosec@latest
install-hooks: ## Install git pre-commit hook
@mkdir -p .git/hooks
@echo '#!/bin/sh' > .git/hooks/pre-commit
@echo 'make check' >> .git/hooks/pre-commit
@chmod +x .git/hooks/pre-commit
@echo "Pre-commit hook installed"
check: lint test security ## Run lint, tests, and security scan
@echo "All checks passed!"
ci: clean check coverage test-bench ## Full CI simulation
@echo "CI simulation complete!"