Skip to content

Instantly share code, notes, and snippets.

@maxpoletaev
Last active November 2, 2020 14:40
Show Gist options
  • Save maxpoletaev/61eb4e15c29a58d0fae9bbd9eff2bb50 to your computer and use it in GitHub Desktop.
Save maxpoletaev/61eb4e15c29a58d0fae9bbd9eff2bb50 to your computer and use it in GitHub Desktop.
Help command for Makefile
# Based on https://diamantidis.github.io/tips/2020/07/01/list-makefile-targets
# With support of multiple words in the help meessage
.DEFAULT_GOAL := help
.PHONY: help test
help:
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) \
| sed -n 's/^\(.*\): \(.*\)## \(.*\)/\1;\3/p' \
| column -t -s ';'
test: ## Run tests
mypy src
pytest -s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment