From d66d34beaf92c229acf375bc8724a87ed276c38b Mon Sep 17 00:00:00 2001 From: oedokumaci Date: Fri, 28 Apr 2023 11:14:16 +0300 Subject: [PATCH] ci: feat add makefile help and improve makefile --- Makefile | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 244b052..55af244 100644 --- a/Makefile +++ b/Makefile @@ -1,29 +1,35 @@ -.PHONY: setup run help test pre-commit clean +.PHONY: help setup run project-help test pre-commit clean -setup: # Setup project +help: ## Show this help message for each Makefile recipe. +ifeq ($(OS),Windows_NT) + @findstr /R /C:"^[a-zA-Z0-9 -]\+:.*##" $(MAKEFILE_LIST) | awk -F ':.*##' '{printf "\033[1;32m%-15s\033[0m %s\n", $$1, $$2}' | sort +else + @awk -F ':.*##' '/^[^ ]+:[^:]+##/ {printf "\033[1;32m%-15s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST) | sort +endif + +setup: ## Setup project pdm install pdm run pre-commit install -run: # Run project +run: ## Run project pdm run python -m gale_shapley -help: # Show project help +project-help: ## Show project help pdm run python -m gale_shapley --help -test: clean # Run tests +test: clean ## Run tests pdm run pytest tests -v -pre-commit: # Run pre-commit +pre-commit: ## Run pre-commit pdm run pre-commit run --all-files +clean: ## Clean cached files ifeq ($(OS),Windows_NT) -clean: # Clean cached files if exists .mypy_cache rmdir /s /q .mypy_cache if exists .pytest_cache rmdir /s /q .pytest_cache if exists src\gale_shapley\__pycache__ rmdir /s /q src\gale_shapley\__pycache__ if exists tests\__pycache__ rmdir /s /q tests\__pycache__ else -clean: # Clean cached files rm -rf .mypy_cache rm -rf .pytest_cache rm -rf src/gale_shapley/__pycache__