2023-02-22 08:49:38 +08:00
|
|
|
default_language_version:
|
|
|
|
python: python3
|
2023-12-30 10:23:12 +08:00
|
|
|
exclude: 'dotnet'
|
2023-02-22 08:49:38 +08:00
|
|
|
ci:
|
|
|
|
autofix_prs: true
|
|
|
|
autoupdate_commit_msg: '[pre-commit.ci] pre-commit suggestions'
|
2024-03-19 10:55:37 +08:00
|
|
|
autoupdate_schedule: 'monthly'
|
2021-09-11 07:39:16 +08:00
|
|
|
|
|
|
|
repos:
|
|
|
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
2024-03-19 10:55:37 +08:00
|
|
|
rev: v4.5.0
|
2021-09-11 07:39:16 +08:00
|
|
|
hooks:
|
|
|
|
- id: check-added-large-files
|
|
|
|
- id: check-ast
|
2023-02-22 08:49:38 +08:00
|
|
|
- id: check-yaml
|
|
|
|
- id: check-toml
|
|
|
|
- id: check-json
|
2021-09-11 07:39:16 +08:00
|
|
|
- id: check-byte-order-marker
|
2023-03-01 00:27:14 +08:00
|
|
|
exclude: .gitignore
|
2021-09-11 07:39:16 +08:00
|
|
|
- id: check-merge-conflict
|
|
|
|
- id: detect-private-key
|
|
|
|
- id: trailing-whitespace
|
2023-03-01 00:27:14 +08:00
|
|
|
- id: end-of-file-fixer
|
|
|
|
- id: no-commit-to-branch
|
2023-04-28 09:54:55 +08:00
|
|
|
- repo: https://github.com/psf/black
|
2024-03-19 10:55:37 +08:00
|
|
|
rev: 24.3.0
|
2023-04-28 09:54:55 +08:00
|
|
|
hooks:
|
|
|
|
- id: black
|
2024-04-01 12:38:25 +08:00
|
|
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
|
|
rev: v0.3.4
|
2023-04-28 09:54:55 +08:00
|
|
|
hooks:
|
|
|
|
- id: ruff
|
2024-04-01 12:38:25 +08:00
|
|
|
types_or: [ python, pyi, jupyter ]
|
|
|
|
args: ["--fix", "--ignore=E402"]
|
2024-01-07 09:41:33 +08:00
|
|
|
- repo: https://github.com/codespell-project/codespell
|
|
|
|
rev: v2.2.6
|
|
|
|
hooks:
|
|
|
|
- id: codespell
|
2024-03-13 04:57:32 +08:00
|
|
|
args: ["-L", "ans,linar,nam,tread,ot,"]
|
2024-01-07 09:41:33 +08:00
|
|
|
exclude: |
|
|
|
|
(?x)^(
|
|
|
|
pyproject.toml |
|
|
|
|
website/static/img/ag.svg |
|
|
|
|
website/yarn.lock |
|
2024-03-10 01:45:58 +08:00
|
|
|
website/docs/tutorial/code-executors.ipynb |
|
2024-04-18 15:53:19 +08:00
|
|
|
website/docs/topics/code-execution/custom-executor.ipynb |
|
2024-04-17 08:24:07 +08:00
|
|
|
website/docs/topics/non-openai-models/cloud-gemini.ipynb |
|
2024-01-07 09:41:33 +08:00
|
|
|
notebook/.*
|
|
|
|
)$
|
2024-03-20 10:01:16 +08:00
|
|
|
# See https://jaredkhan.com/blog/mypy-pre-commit
|
|
|
|
- repo: local
|
|
|
|
hooks:
|
|
|
|
- id: mypy
|
|
|
|
name: mypy
|
|
|
|
entry: "./scripts/pre-commit-mypy-run.sh"
|
|
|
|
language: python
|
|
|
|
# use your preferred Python version
|
|
|
|
# language_version: python3.8
|
2024-03-22 02:54:39 +08:00
|
|
|
additional_dependencies: []
|
2024-03-20 10:01:16 +08:00
|
|
|
types: [python]
|
|
|
|
# use require_serial so that script
|
|
|
|
# is only called once per commit
|
|
|
|
require_serial: true
|
|
|
|
# Print the number of files as a sanity-check
|
|
|
|
verbose: true
|
2024-01-08 11:47:01 +08:00
|
|
|
- repo: https://github.com/nbQA-dev/nbQA
|
2024-04-01 12:38:25 +08:00
|
|
|
rev: 1.8.5
|
2024-01-08 11:47:01 +08:00
|
|
|
hooks:
|
|
|
|
- id: nbqa-black
|