diff --git a/.githooks/pre-commit b/.githooks/pre-commit new file mode 100755 index 000000000..f5008c586 --- /dev/null +++ b/.githooks/pre-commit @@ -0,0 +1,2 @@ + +make format \ No newline at end of file diff --git a/Makefile b/Makefile index 0d8556e47..3143d7983 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,13 @@ -.PHONY: all format lint build build_frontend install_frontend run_frontend run_backend dev help tests coverage +.PHONY: all init format lint build build_frontend install_frontend run_frontend run_backend dev help tests coverage all: help +init: + @echo 'Installing pre-commit hooks' + git config core.hooksPath .githooks + pre-commit install + pre-commit install --hook-type pre-push + coverage: poetry run pytest --cov \ --cov-config=.coveragerc \ @@ -14,6 +20,7 @@ tests: format: poetry run black . poetry run ruff --select I --fix . + cd src/frontend && npm run format lint: poetry run mypy .