-
Notifications
You must be signed in to change notification settings - Fork 407
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
77 lines (76 loc) · 2.13 KB
/
.pre-commit-config.yaml
File metadata and controls
77 lines (76 loc) · 2.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
files: >
(?x)^(
xtuner/v1/.* |
autotest/.*
)$
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-yaml
- id: requirements-txt-fixer
- id: check-merge-conflict
- id: mixed-line-ending
args: ["--fix=lf"]
- repo: https://github.com/codespell-project/codespell
rev: v2.2.1
hooks:
- id: codespell
- repo: https://github.com/executablebooks/mdformat
rev: 0.7.9
hooks:
- id: mdformat
args: ["--number"]
additional_dependencies:
- mdformat-openmmlab
- mdformat_frontmatter
- linkify-it-py
exclude: 'docs/zh_cn/user_guides/sequence_parallel.md'
- repo: https://github.com/myint/docformatter
rev: 06907d0
hooks:
- id: docformatter
args: ["--in-place", "--wrap-descriptions", "119"]
- repo: https://github.com/asottile/pyupgrade
rev: v3.20.0
hooks:
- id: pyupgrade
args: ["--py36-plus"]
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.9.10
hooks:
# Run the linter.
- id: ruff
types_or: [ python, pyi ]
args: [ --diff ]
- id: ruff
types_or: [ python, pyi ]
args: [ --fix ]
# Run the formatter.
- id: ruff-format
types_or: [ python, pyi ]
args: [ --diff ]
- id: ruff-format
types_or: [ python, pyi ]
- repo: local
# We do not use pre-commit/mirrors-mypy,
# as it comes with opinionated defaults
# (like --ignore-missing-imports)
# and is difficult to configure to run
# with the dependencies correctly installed.
hooks:
- id: mypy
name: mypy
entry: .dev_scripts/mypy_entrypoint.sh
language: python
# For 3rd party lib, we only do type check for torch
additional_dependencies: ["mypy==1.16.1", "torch==2.6.0", "types-requests"]
require_serial: true
verbose: true
types: [python]
- id: pydantic-extra-check
name: pydantic-extra-check
language: system
entry: .dev_scripts/test_pydantic.py
verbose: false