diff --git a/Makefile b/Makefile index 829bf2d..8543f6c 100644 --- a/Makefile +++ b/Makefile @@ -1,14 +1,18 @@ POETRY_EXISTS := $(shell which poetry &> /dev/null) +PRE_COMMIT_EXISTS := $(shell poetry run which pre-commit &> /dev/null) PRE_COMMIT_HOOK := .git/hooks/pre-commit -pre-commit: +pre-commit: setup-development-environment poetry run pre-commit install-poetry: ifndef POETRY_EXISTS curl -sSL https://install.python-poetry.org | POETRY_VERSION=1.4.0 python3 - endif - poetry install + +ifndef PRE_COMMIT_EXISTS + poetry run pip install $(shell poetry export --without-hashes --with dev | grep pre-commit | cut -d";" -f1) +endif $(PRE_COMMIT_HOOK): poetry run pre-commit install --install-hooks