Skip to content

Commit

Permalink
ci: feat add makefile help and improve makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
oedokumaci committed Apr 28, 2023
1 parent deef876 commit d66d34b
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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__
Expand Down

0 comments on commit d66d34b

Please sign in to comment.