Skip to content

Commit

Permalink
feat: Add make format
Browse files Browse the repository at this point in the history
  • Loading branch information
saattrupdan committed Jul 16, 2024
1 parent 7f45059 commit e3af125
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions {{cookiecutter.project_name}}/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ The project includes the following convenience commands:
- `make install`: Install the project and its dependencies in a virtual environment.
- `make install-pre-commit`: Install pre-commit hooks for linting, formatting and type checking.
- `make lint`: Lint the code using `ruff`.
- `make format`: Format the code using `ruff`.
- `make type-check`: Type check the code using `mypy`.
- `make test`: Run tests using `pytest` and update the coverage badge in the readme.
- `make docker`: Build a Docker image and run the Docker container.
Expand Down
7 changes: 7 additions & 0 deletions {{cookiecutter.project_name}}/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,13 @@ lint: ## Lint the project
. .venv/bin/activate && ruff check src --fix
{%- endif %}

format: ## Format the project
{% if cookiecutter.dependency_manager != 'pip' -%}
poetry run ruff format src
{%- else -%}
. .venv/bin/activate && ruff format src
{%- endif %}

type-check: ## Type-check the project
{% if cookiecutter.dependency_manager != 'pip' -%}
@poetry run mypy src --install-types --non-interactive --ignore-missing-imports --show-error-codes --check-untyped-defs
Expand Down

0 comments on commit e3af125

Please sign in to comment.