| 1 |
ci: |
| 2 |
autofix_prs: true |
| 3 |
autoupdate_schedule: weekly |
| 4 |
submodules: false |
| 5 |
# pip-compile requires internet, regenerate-files may get cache |
| 6 |
# issues in CI, so they're run in check.sh |
| 7 |
skip: [pip-compile, regenerate-files] |
| 8 |
|
| 9 |
repos: |
| 10 |
- repo: https://github.com/pre-commit/pre-commit-hooks |
| 11 |
rev: v6.0.0 |
| 12 |
hooks: |
| 13 |
- id: trailing-whitespace |
| 14 |
- id: end-of-file-fixer |
| 15 |
- id: check-yaml |
| 16 |
- id: check-toml |
| 17 |
- id: check-merge-conflict |
| 18 |
- id: mixed-line-ending |
| 19 |
- id: check-case-conflict |
| 20 |
- id: sort-simple-yaml |
| 21 |
files: .pre-commit-config.yaml |
| 22 |
- repo: https://github.com/psf/black-pre-commit-mirror |
| 23 |
rev: 26.5.1 |
| 24 |
hooks: |
| 25 |
- id: black |
| 26 |
- repo: https://github.com/astral-sh/ruff-pre-commit |
| 27 |
rev: v0.16.2 |
| 28 |
hooks: |
| 29 |
- id: ruff-check |
| 30 |
types: [file] |
| 31 |
types_or: [python, pyi, toml] |
| 32 |
args: ["--show-fixes"] |
| 33 |
- repo: https://github.com/codespell-project/codespell |
| 34 |
rev: v2.4.3 |
| 35 |
hooks: |
| 36 |
- id: codespell |
| 37 |
additional_dependencies: |
| 38 |
# tomli needed on 3.10. tomllib is available in stdlib on 3.11+ |
| 39 |
- tomli |
| 40 |
- repo: https://github.com/adhtruong/mirrors-typos |
| 41 |
rev: v1.49.0 |
| 42 |
hooks: |
| 43 |
- id: typos |
| 44 |
- repo: https://github.com/sphinx-contrib/sphinx-lint |
| 45 |
rev: v1.0.2 |
| 46 |
hooks: |
| 47 |
- id: sphinx-lint |
| 48 |
- repo: local |
| 49 |
hooks: |
| 50 |
- id: regenerate-files |
| 51 |
name: regenerate generated files |
| 52 |
language: python |
| 53 |
entry: python src/trio/_tools/gen_exports.py |
| 54 |
pass_filenames: false |
| 55 |
additional_dependencies: ["astor", "attrs", "black", "ruff>=0.15.22"] |
| 56 |
files: ^src\/trio\/_core\/(_run|(_i(o_(common|epoll|kqueue|windows)|nstrumentation)))\.py$ |
| 57 |
- id: regenerate-windows-cffi |
| 58 |
name: regenerate windows CFFI |
| 59 |
language: python |
| 60 |
entry: python src/trio/_tools/windows_ffi_build.py |
| 61 |
pass_filenames: false |
| 62 |
additional_dependencies: ["cffi"] |
| 63 |
files: ^src\/trio\/_tools\/windows_ffi_build\.py$ |
| 64 |
- id: sync-test-requirements |
| 65 |
name: synchronize test requirements |
| 66 |
language: python |
| 67 |
entry: python src/trio/_tools/sync_requirements.py |
| 68 |
pass_filenames: false |
| 69 |
additional_dependencies: ["pyyaml"] |
| 70 |
files: ^(test-requirements\.txt)|(\.pre-commit-config\.yaml)$ |
| 71 |
- repo: https://github.com/astral-sh/uv-pre-commit |
| 72 |
rev: 0.12.3 |
| 73 |
hooks: |
| 74 |
# Compile requirements |
| 75 |
- id: pip-compile |
| 76 |
name: uv pip-compile test-requirements.in |
| 77 |
args: [ |
| 78 |
"--universal", |
| 79 |
"--python-version=3.10", |
| 80 |
"test-requirements.in", |
| 81 |
"-o", |
| 82 |
"test-requirements.txt"] |
| 83 |
files: ^test-requirements\.(in|txt)$ |
| 84 |
- id: pip-compile |
| 85 |
name: uv pip-compile docs-requirements.in |
| 86 |
args: [ |
| 87 |
"--universal", |
| 88 |
"--python-version=3.11", |
| 89 |
"docs-requirements.in", |
| 90 |
"-o", |
| 91 |
"docs-requirements.txt"] |
| 92 |
files: ^docs-requirements\.(in|txt)$ |