testmark-bash

Makefile

.DEFAULT_GOAL := help

SHELL  = /bin/bash
.SHELLFLAGS = -o pipefail -c

.PHONY: all
all: fmt test ## Everything that's a must before committing: fmt, test.

.PHONY: help
help: ## Print info about all commands
	@echo "Commands:"
	@echo
	@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) \
		| awk 'BEGIN {FS = ":.*?## "}; {printf "    \033[01;32m%-20s\033[0m %s\n", $$1, $$2}'

.PHONY: setup
setup: ## One-time dev env setup: activate git hooks.
	git config core.hooksPath hack/git-hooks

.PHONY: fmt
fmt: ## Format source in place.
	shfmt -w .

.PHONY: check
check: ## Verify-only and fast; run by the pre-commit hook on every commit.
	shfmt -d .
	shellcheck -x -S warning lib/*.bash lib/*/*.bash tests/*.sh examples/*.sh

.PHONY: test
test: ## Run all tests.
	tests/run.sh
	examples/test-todos.sh

Makefile · 803 B · e85d9b9d37