From 62ccab685e332eacf578ef2644e9784f704be067 Mon Sep 17 00:00:00 2001 From: Amine Louzar <66479002+qbecb1zen@users.noreply.github.com> Date: Thu, 3 Mar 2022 15:20:09 +0100 Subject: [PATCH] add makefile with a few commands (#2058) * improv: add makefile with a few commands * improv: hide help command whenever executed --- Makefile | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 000000000000..bb341b794457 --- /dev/null +++ b/Makefile @@ -0,0 +1,24 @@ +PYTHON_FILEPATHS = `(find . -iname "*.py" -not -path "./.venv/*")` +lint: ## Lint codebase + poetry run pylint --rcfile=pylintrc $(PYTHON_FILEPATHS) + +format: ## Run black formatter + poetry run black --check $(PYTHON_FILEPATHS) + +format-fix: ## Run black formatter with automated fix + poetry run black $(PYTHON_FILEPATHS) + +type-check: ## Run black formatter with automated fix + poetry run mypy $(PYTHON_FILEPATHS) + +pycache-delete: ## Delete the __pycache__ folders + find . -type d -name __pycache__ -exec rm -r {} \+ + +clean: ## Delete cache generated + rm -fr .mypy_cache/ .pytest_cache/ && make pycache-delete + +backend-ci: ## Run python corresponding ci + make format && make lint && make type-check + +help: + @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-25s\033[0m %s\n", $$1, $$2}'