forked from radixark/miles
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
62 lines (54 loc) · 1.86 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
62 lines (54 loc) · 1.86 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
default_language_version:
python: python3
ci:
autofix_prs: true
autoupdate_commit_msg: '[pre-commit.ci] pre-commit suggestions'
autoupdate_schedule: quarterly
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-yaml
- id: check-case-conflict
- id: detect-private-key
- id: check-added-large-files
args: ['--maxkb=1000']
- id: requirements-txt-fixer
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.14.7
hooks:
- id: ruff-check
args: [ --fix ]
- repo: https://github.com/PyCQA/autoflake
rev: v2.0.2
hooks:
- id: autoflake
args: [--remove-all-unused-imports, --in-place]
- repo: https://github.com/pycqa/isort
rev: 5.13.2 # 选一个稳定版本
hooks:
- id: isort
args:
- "--profile=black" # 常见:与 Black 对齐风格
- "--filter-files" # 忽略已在 .gitignore 的文件
additional_dependencies: [] # 需要插件时在这里加
- repo: https://github.com/psf/black
rev: 24.3.0
hooks:
- id: black
name: Format code
additional_dependencies: ['click==8.0.2']
- repo: local
hooks:
- id: ban-mpu-get
name: Ban direct mpu.get_* calls (use ParallelState)
language: pygrep
entry: 'mpu\.get_'
types: [python]
exclude: '(backends/megatron_utils/parallel\.py|tools/convert_to_hf\.py|miles_plugins/|examples/)'
- id: ban-bare-auto-loaders
name: Ban bare Auto{Config,Tokenizer}.from_pretrained (use load_hf_config / load_tokenizer)
language: pygrep
entry: '(AutoConfig|AutoTokenizer)\.from_pretrained'
types: [python]
exclude: '(miles/utils/hf_config\.py|miles/utils/processing_utils\.py|tests/|test_utils/|miles_plugins/|examples/)'