diff --git a/Makefile b/Makefile index f32cf4a8..4637f32b 100644 --- a/Makefile +++ b/Makefile @@ -1,65 +1,97 @@ -init: +.DEFAULT_GOAL := help + +help: + @echo + @echo " ____ __ _ ____ __ " + @echo " / __ \/ /___ _____ ____ (_)___ ____ _ / __ \____ _/ /_____ _" + @echo " / /_/ / / __ \`/ __ \/ __ \/ / __ \/ __ \`/ / / / / __ \`/ __/ __ \`/" + @echo " / ____/ / /_/ / / / / / / / / / / / /_/ / / /_/ / /_/ / /_/ /_/ / " + @echo "/_/ /_/\__,_/_/ /_/_/ /_/_/_/ /_/\__, / /_____/\__,_/\__/\__,_/ " + @echo " /____/ " + @echo + @echo "Usage: make " + @echo + @cat $(MAKEFILE_LIST) | grep -E '^[a-zA-Z_-]+:.*?## .*$$' | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-10s\033[0m %s\n", $$1, $$2}' + @echo + +.PHONY: init +init:: ## Install python and node.js dependencies + python -m pip install --upgrade pip + python -m pip install pip-tools + python -m piptools sync requirements/dev-requirements.txt requirements/requirements.txt + python -m pre_commit install npm install - python -m pip install --upgrade pip setuptools wheel - python -m pip install -r requirements.txt -reqs: +.PHONY: reqs +reqs: ## Install python dependencies python -m piptools compile requirements/dev-requirements.in python -m piptools compile requirements/requirements.in -sync: +.PHONY: sync +sync: ## Sync python dependencies if requirements change python -m piptools sync requirements/requirements.txt requirements/dev-requirements.txt -upgrade: +.PHONY: upgrade +upgrade: ## Upgrade python dependencies python -m piptools compile --upgrade requirements/dev-requirements.in python -m piptools compile --upgrade requirements/requirements.in python -m piptools sync requirements/requirements.txt requirements/dev-requirements.txt -black: +.PHONY: black +black: ## Format code with black black . -black-check: +.PHONY: black-check +black-check: ## Check code format with black black --check . -flake8: +.PHONY: flake8 +flake8: ## Lint code with flake8 flake8 . -isort: +.PHONY: isort +isort: ## Implement isort to sort imports isort --profile black . -lint: black-check flake8 +.PHONY: lint +lint: black-check flake8 ## Lint code with black and flake8 -run:: +.PHONY: run +run:: ## Run app locally flask run -watch: +.PHONY: watch +watch: ## Run app with auto-reload on code changes npm run watch -upgrade-db: +.PHONY: upgrade-db +upgrade-db: ## Upgrade the database to the latest migration @echo "Now running 'upgrade-db'....." flask db upgrade -downgrade-db: +.PHONY: downgrade-db +downgrade-db: ## Downgrade the database to the previous migration flask db downgrade -load-data: +.PHONY: load-data +load-data: ## Load sample data into the database flask data load --spec 1 --config 1 -drop-data: +.PHONY: drop-data +drop-data: ## Drop all data from the database flask data drop -test-unit: +.PHONY: test-unit +test-unit: ## Run unit tests @echo "Running Unit test...." @echo "Not yet implemented" -test-integration: +.PHONY: test-integration +test-integration: ## Run integration tests @echo "Running Integration test...." @echo "Not yet implemented" -test-acceptance: +.PHONY: test-acceptance +test-acceptance: ## Run acceptance testsß @echo "Running Acceptance test...." @echo "Not yet implemented" - -test-accessibility: - @echo "Running Accessibility test...." - @echo "Not yet implemented"