diff --git a/{{ cookiecutter.project_slug }}/Makefile b/{{ cookiecutter.project_slug }}/Makefile index 95b1d49..14706b8 100644 --- a/{{ cookiecutter.project_slug }}/Makefile +++ b/{{ cookiecutter.project_slug }}/Makefile @@ -9,6 +9,9 @@ api-test: api-check-migrations: cd docker/ && docker compose run --rm api make check-migrations +api-migrate: + cd docker/ && docker compose run --rm api make migrate + api-check: cd docker/ && docker compose run --rm api make check @@ -26,6 +29,3 @@ compose-down: compose-build: cd docker/ && docker compose build - -api-migrate: - cd docker/ && docker compose run --rm api make migrate diff --git a/{{ cookiecutter.project_slug }}/README.md b/{{ cookiecutter.project_slug }}/README.md index 735c42d..1a5495d 100644 --- a/{{ cookiecutter.project_slug }}/README.md +++ b/{{ cookiecutter.project_slug }}/README.md @@ -56,3 +56,7 @@ minimal setup. If you need python environment, to run some commands, just use `make api-bash`, and you will be in the container with all dependencies installed. +> [!NOTE] +> To ensure your code follow the standards etc. we strongly recommend to use `pre-commit` locally, that means you need +> to have it installed manually, see [pre-commit hook docs](docs/pre_commit_hook.md) for more details. + diff --git a/{{ cookiecutter.project_slug }}/docs/pre_commit_hook.md b/{{ cookiecutter.project_slug }}/docs/pre_commit_hook.md index d831c04..4ddac6f 100644 --- a/{{ cookiecutter.project_slug }}/docs/pre_commit_hook.md +++ b/{{ cookiecutter.project_slug }}/docs/pre_commit_hook.md @@ -2,11 +2,18 @@ To run additional checks before making commit we use [Pre-commit](https://pre-commit.com/) hooks. -`pre-commit` package is installed with backend requirements, so there is no need of [manual installation](https://pre-commit.com/#install). -But you need to generate the actual git pre-commit hook. It should be done only once: + +Since the `api` is running inside docker container we don't have a pre-commit as a dependency there, so you need to +install `pre-commit` package [manually](https://pre-commit.com/#install). + +> [!NOTE] +> The `safety` hook also requires `poetry` to be in your `PATH`. +> Ensure the poetry installed with the same python version as in `pyproject.toml` + +You need to generate the actual git pre-commit hook. It should be done only once: ```bash -pre-commit install +pre-commit install --install-hooks ``` To run pre-commit hooks manually: