| 1 |
# See https://pre-commit.com for more information |
| 2 |
# See https://pre-commit.com/hooks.html for more hooks |
| 3 |
repos: |
| 4 |
- repo: https://github.com/pre-commit/pre-commit-hooks |
| 5 |
rev: 3e8a8703264a2f4a69428a0aa4dcb512790b2c8c # v6.0.0 |
| 6 |
hooks: |
| 7 |
- id: check-added-large-files |
| 8 |
args: ['--maxkb=750'] |
| 9 |
exclude: ^uv.lock$ |
| 10 |
- id: check-toml |
| 11 |
- id: check-yaml |
| 12 |
args: |
| 13 |
- --unsafe |
| 14 |
- id: end-of-file-fixer |
| 15 |
- id: trailing-whitespace |
| 16 |
|
| 17 |
- repo: https://github.com/crate-ci/typos |
| 18 |
rev: bee27e3a4fd1ea2111cf90ab89cd076c870fce14 # frozen: v1.48.0 |
| 19 |
hooks: |
| 20 |
- id: typos |
| 21 |
args: [--force-exclude] |
| 22 |
|
| 23 |
- repo: local |
| 24 |
hooks: |
| 25 |
- id: local-ruff-check |
| 26 |
name: ruff check |
| 27 |
entry: uv run ruff check --force-exclude --fix --exit-non-zero-on-fix |
| 28 |
require_serial: true |
| 29 |
language: unsupported |
| 30 |
types: [python] |
| 31 |
|
| 32 |
- id: local-ruff-format |
| 33 |
name: ruff format |
| 34 |
entry: uv run ruff format --force-exclude --exit-non-zero-on-format |
| 35 |
require_serial: true |
| 36 |
language: unsupported |
| 37 |
types: [python] |
| 38 |
|
| 39 |
- id: local-mypy |
| 40 |
name: mypy check |
| 41 |
entry: uv run mypy fastapi |
| 42 |
require_serial: true |
| 43 |
language: unsupported |
| 44 |
pass_filenames: false |
| 45 |
|
| 46 |
- id: local-ty |
| 47 |
name: ty check |
| 48 |
entry: uv run ty check |
| 49 |
require_serial: true |
| 50 |
language: unsupported |
| 51 |
pass_filenames: false |
| 52 |
|
| 53 |
- id: add-permalinks-pages |
| 54 |
language: unsupported |
| 55 |
name: add-permalinks-pages |
| 56 |
entry: uv run ./scripts/docs.py add-permalinks-pages |
| 57 |
args: |
| 58 |
- --update-existing |
| 59 |
files: ^docs/en/docs/.*\.md$ |
| 60 |
|
| 61 |
- id: generate-readme |
| 62 |
language: unsupported |
| 63 |
name: generate README.md from index.md |
| 64 |
entry: uv run ./scripts/docs.py generate-readme |
| 65 |
files: ^docs/en/docs/index\.md|docs/en/data/sponsors\.yml|scripts/docs\.py$ |
| 66 |
pass_filenames: false |
| 67 |
|
| 68 |
- id: render-banner-sponsors |
| 69 |
language: unsupported |
| 70 |
name: render sponsor banner partial |
| 71 |
entry: uv run ./scripts/docs.py render-banner-sponsors |
| 72 |
files: ^docs/en/data/sponsors\.yml|^docs/en/overrides/partials/banner-sponsors\.html|^scripts/docs\.py$ |
| 73 |
pass_filenames: false |
| 74 |
|
| 75 |
- id: update-languages |
| 76 |
language: unsupported |
| 77 |
name: update languages |
| 78 |
entry: uv run ./scripts/docs.py update-languages |
| 79 |
files: ^docs/.*|scripts/docs\.py$ |
| 80 |
pass_filenames: false |
| 81 |
|
| 82 |
- id: ensure-non-translated |
| 83 |
language: unsupported |
| 84 |
name: ensure non-translated files are not modified |
| 85 |
entry: uv run ./scripts/docs.py ensure-non-translated |
| 86 |
files: ^docs/(?!en/).*|^scripts/docs\.py$ |
| 87 |
pass_filenames: false |
| 88 |
|
| 89 |
- id: fix-translations |
| 90 |
language: unsupported |
| 91 |
name: fix translations |
| 92 |
entry: uv run ./scripts/translation_fixer.py fix-pages |
| 93 |
files: ^docs/(?!en/).*/docs/.*\.md$ |
| 94 |
|
| 95 |
- id: add-release-date |
| 96 |
language: unsupported |
| 97 |
name: add date to latest release header |
| 98 |
entry: uv run python scripts/add_latest_release_date.py |
| 99 |
files: ^docs/en/docs/release-notes\.md$ |
| 100 |
pass_filenames: false |
| 101 |
|
| 102 |
- id: zizmor |
| 103 |
name: zizmor |
| 104 |
language: python |
| 105 |
entry: uv run zizmor . |
| 106 |
files: ^\.github/workflows/|^uv\.lock$ |
| 107 |
require_serial: true |
| 108 |
pass_filenames: false |