-
Notifications
You must be signed in to change notification settings - Fork 471
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
118 lines (108 loc) · 3.27 KB
/
.pre-commit-config.yaml
File metadata and controls
118 lines (108 loc) · 3.27 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
default_install_hook_types:
- pre-commit
- commit-msg
repos:
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v19.1.7
hooks:
- id: clang-format
files: \.(c|cc|cxx|cpp|h|hpp|hxx|cu|cuh)$
args:
- --style=file
- --fallback-style=Google
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: check-yaml
files: \.(yaml|yml)$
exclude: \.github/workflows/
- id: end-of-file-fixer
files: \.(py|md|yaml|yml|c|cc|cxx|cpp|h|hpp|hxx|cu|cuh|ipynb)$
- id: trailing-whitespace
files: \.(py|md|yaml|yml|c|cc|cxx|cpp|h|hpp|hxx|cu|cuh|ipynb)$
- id: check-added-large-files
name: Check for large files
args: ['--maxkb=1000']
exclude: uv.lock
- id: check-json
name: Check JSON files
- id: detect-private-key
name: Detect private keys
- repo: https://github.com/executablebooks/mdformat
rev: 0.7.17
hooks:
- id: mdformat
args:
- --wrap=88
additional_dependencies:
- mdformat-gfm
- mdformat-tables
- mdformat-frontmatter
exclude: ^(docs/(en|zh)/algorithms/.*\.md|docs/(en|zh)/best_practices/algo_perf\.md)$
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.14.9
hooks:
- id: ruff # Run the linter.
name: Run Linter Check (Ruff)
types_or: [ python, pyi, jupyter ]
args: [ --fix ]
- id: ruff-format # Run the formatter.
name: Run Formatter (Ruff)
types_or: [ python, pyi, jupyter ]
# Clean notebook outputs and metadata
- repo: https://github.com/kynan/nbstripout
rev: 0.7.1
hooks:
- id: nbstripout
name: nbstripout - Strip notebook output
description: Strip output from Jupyter notebooks
# Check consistency between pyproject.toml variants (sglang vs vllm)
- repo: local
hooks:
- id: check-pyproject-consistency
name: Check pyproject.toml consistency
entry: python3 areal/tools/check_pyproject_consistency.py
language: system
files: ^pyproject(\.vllm)?\.toml$
pass_filenames: false
always_run: false
require_serial: true
# Generate CLI documentation
- repo: local
hooks:
- id: generate-cli-docs
name: Generate CLI documentation
entry: python docs/generate_cli_docs.py
language: system
files: ^(areal/api/cli_args\.py|docs/generate_cli_docs\.py)$
pass_filenames: false
always_run: false
require_serial: true
# Ensure SPDX license header in Python source files
- repo: local
hooks:
- id: check-license-header
name: Check SPDX license header
entry: python3 areal/tools/check_license_header.py
language: system
files: ^areal/.*\.py$
types: [python]
# Conventional Commits message check
- repo: https://github.com/compilerla/conventional-pre-commit
rev: v4.4.0
hooks:
- id: conventional-pre-commit
stages: [commit-msg]
args:
- feat
- fix
- docs
- style
- refactor
- perf
- test
- build
- ci
- chore
- revert