Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 45 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,15 @@ repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: check-added-large-files
- id: check-toml
- id: check-yaml
args:
- --unsafe
- id: end-of-file-fixer
- id: check-added-large-files
- id: check-toml
- id: check-yaml
args: [--unsafe]
- id: end-of-file-fixer
files: tortoise/
- id: trailing-whitespace
- id: trailing-whitespace
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: 'v0.15.9'
rev: v0.15.9
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix, --show-fixes, tortoise/, examples/, tests/, conftest.py]
Expand All @@ -28,3 +27,41 @@ repos:
- id: codespell # See pyproject.toml for args
additional_dependencies:
- tomli

- repo: local
hooks:
- id: mypy
name: Check type hints by mypy
entry: uv run --frozen mypy
language: system
args: [tortoise/, examples/, tests/, conftest.py]
pass_filenames: false
groups: [check]
stages: [manual]

- id: bandit
name: Check security by bandit
entry: uv run --frozen bandit
language: system
args: [-c, pyproject.toml, -r, tortoise/, examples/, tests/, conftest.py]
pass_filenames: false
groups: [check]
stages: [manual]

- id: build
name: Build sdist by uv
entry: uv build
language: system
pass_filenames: false
groups: [check]
stages: [manual]

- id: twine
name: Check sdist by twine
entry: uv run --frozen twine check dist/*
language: system
pass_filenames: false
require_serial: true
priority: 2
groups: [check]
stages: [manual]
7 changes: 4 additions & 3 deletions docs/CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Contribution Guide
CODE_OF_CONDUCT


If you want to contribute check out issues, or just straightforwardly create PR.
If you want to contribute, check out the issues, or just create a PR.

Tortoise ORM is a volunteer effort. We encourage you to pitch in and join the team!

Expand Down Expand Up @@ -66,7 +66,7 @@ The code is structured in the following directories:
Coding Guideline
================

We believe to keep the code simple, so it is easier to test and there is less place for bugs to hide.
We believe in keeping the code simple, so it is easier to test and there are fewer places for bugs to hide.

Priorities
----------
Expand All @@ -84,7 +84,8 @@ As this is a value that is different for different people, we have settled on:
Style
-----

We try and automate as much as we can, so a simple ``make check`` will do automated style checking and linting, but these don't pick up on the non-obvious style preferences.
We try and automate as much as we can, so a simple ``make style`` (or ``uvx prek run --all-files``) will do automated formatting, style checking and linting, but these don't pick up on the non-obvious style preferences.
Before creating a PR, please run ``make check`` (or ``uvx prek run --all-files --group check``) to ensure code quality.

Tortoise ORM follows a the following agreed upon style:

Expand Down
Loading