From a6afcc9a33866460993f50a880ab42496b8988cc Mon Sep 17 00:00:00 2001 From: eveleighoj <35256612+eveleighoj@users.noreply.github.com> Date: Wed, 17 Sep 2025 10:36:19 +0100 Subject: [PATCH] tidy makerules --- Makefile | 63 +++++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 46 insertions(+), 17 deletions(-) diff --git a/Makefile b/Makefile index 1383fcd4..72c89e48 100644 --- a/Makefile +++ b/Makefile @@ -1,52 +1,81 @@ -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 compile requirements/dev-requirements.in - python -m piptools compile requirements/requirements.in python -m piptools sync requirements/dev-requirements.txt requirements/requirements.txt python -m pre_commit install npm install -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 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