Reviewed-on: #5 Co-authored-by: Igor Ranieri <igor@elland.me> Co-committed-by: Igor Ranieri <igor@elland.me>
44 lines
1.1 KiB
Makefile
44 lines
1.1 KiB
Makefile
.PHONY: help
|
|
help: ## Show this help
|
|
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
|
|
|
|
.PHONY: build
|
|
build: ## Build the project
|
|
cabal build
|
|
|
|
.PHONY: test
|
|
test: ## Run tests
|
|
cabal test --test-show-details=direct
|
|
|
|
.PHONY: clean
|
|
clean: ## Clean build artifacts
|
|
cabal clean
|
|
|
|
.PHONY: fourmolu
|
|
fourmolu: ## Format Haskell code
|
|
find . -type f -name "*.hs" ! -path "./dist-newstyle/*" -exec fourmolu -i {} +
|
|
|
|
.PHONY: fourmolu-check
|
|
fourmolu-check: ## Check if code is formatted
|
|
find . -type f -name "*.hs" ! -path "./dist-newstyle/*" -exec fourmolu --mode check {} \;
|
|
|
|
.PHONY: lint
|
|
lint: ## Run hlint
|
|
hlint src test app
|
|
|
|
.PHONY: cabal-gild
|
|
cabal-gild: ## Format cabal file
|
|
cabal-gild --io=haddock2.cabal
|
|
|
|
.PHONY: format
|
|
format: fourmolu cabal-gild ## Run all formatters
|
|
|
|
.PHONY: check
|
|
check: fourmolu-check lint ## Run all checks (CI-style)
|
|
|
|
.PHONY: ci
|
|
ci: build test check ## Run full CI pipeline locally
|
|
|
|
.PHONY: docs
|
|
docs: ## Generate documentation
|
|
cabal haddock --haddock-hyperlink-source
|