6
0
mirror of https://github.com/ChristianLight/tutor.git synced 2024-12-04 19:03:39 +00:00

build: 'make help' works nicer on Mac

sed on Mac doesn't seem to understand \n.

While I was in here, I fixed some typos.
This commit is contained in:
Ned Batchelder 2022-01-05 10:46:19 -05:00 committed by Régis Behmo
parent ac39f9e6c3
commit f2260006bd

View File

@ -5,7 +5,7 @@ BLACK_OPTS = --exclude templates ${SRC_DIRS}
###### Development
docs: ## Build html documentation
docs: ## Build HTML documentation
$(MAKE) -C docs
compile-requirements: ## Compile requirements files
@ -18,7 +18,7 @@ upgrade-requirements: ## Upgrade requirements files
pip-compile --upgrade requirements/dev.in
pip-compile --upgrade requirements/docs.in
build-pythonpackage: build-pythonpackage-tutor ## Build python packages ready to upload to pypi
build-pythonpackage: build-pythonpackage-tutor ## Build Python packages ready to upload to pypi
build-pythonpackage-tutor: ## Build the "tutor" python package for upload to pypi
python setup.py sdist
@ -26,7 +26,7 @@ build-pythonpackage-tutor: ## Build the "tutor" python package for upload to pyp
push-pythonpackage: ## Push python package to pypi
twine upload --skip-existing dist/tutor-$(shell make version).tar.gz
test: test-lint test-unit test-types test-format test-pythonpackage ## Run all tests by decreasing order or priority
test: test-lint test-unit test-types test-format test-pythonpackage ## Run all tests by decreasing order of priority
test-format: ## Run code formatting tests
black --check --diff $(BLACK_OPTS)
@ -50,7 +50,7 @@ bootstrap-dev: ## Install dev requirements
pip install .
pip install -r requirements/dev.txt
bootstrap-dev-plugins: bootstrap-dev ## Install dev requirement and all supported plugins
bootstrap-dev-plugins: bootstrap-dev ## Install dev requirements and all supported plugins
pip install -r requirements/plugins.txt
###### Code coverage
@ -125,5 +125,5 @@ version: ## Print the current tutor version
ESCAPE = 
help: ## Print this help
@grep -E '^([a-zA-Z_-]+:.*?## .*|######* .+)$$' Makefile \
| sed 's/######* \(.*\)/\n $(ESCAPE)[1;31m\1$(ESCAPE)[0m/g' \
| sed 's/######* \(.*\)/@ $(ESCAPE)[1;31m\1$(ESCAPE)[0m/g' | tr '@' '\n' \
| awk 'BEGIN {FS = ":.*?## "}; {printf "\033[33m%-30s\033[0m %s\n", $$1, $$2}'