Skip to content

Commit

Permalink
[DI-2709] Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
bulya committed Oct 14, 2024
1 parent 55afefa commit ecf72d8
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
6 changes: 3 additions & 3 deletions {{ cookiecutter.project_slug }}/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -26,6 +29,3 @@ compose-down:

compose-build:
cd docker/ && docker compose build

api-migrate:
cd docker/ && docker compose run --rm api make migrate
4 changes: 4 additions & 0 deletions {{ cookiecutter.project_slug }}/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
13 changes: 10 additions & 3 deletions {{ cookiecutter.project_slug }}/docs/pre_commit_hook.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit ecf72d8

Please sign in to comment.