-
Notifications
You must be signed in to change notification settings - Fork 983
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
85 lines (81 loc) · 2.12 KB
/
.pre-commit-config.yaml
File metadata and controls
85 lines (81 loc) · 2.12 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
repos:
# Check yaml, end of file, trailing whitespace
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: check-yaml
name: check yaml
- id: end-of-file-fixer
name: fix end of file
- id: trailing-whitespace
name: trim trailing whitespace
# Ruff linter and formatter
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.14.5
hooks:
- id: ruff
name: ruff linting
files: \.py$
args: [--fix]
- id: ruff-format
name: ruff formatting
files: \.py$
# Static type checking
- repo: local
hooks:
- id: ty
name: ty check
entry: uv run ty check .
language: system
pass_filenames: false
types: [python]
# Check Apache license headers
- repo: https://github.com/lucas-c/pre-commit-hooks
rev: v1.5.5
hooks:
- id: insert-license
name: check license headers (Python)
files: \.py$
args:
- --license-filepath
- testing/utils/.license-header.txt
- --comment-style
- "#"
- id: insert-license
name: check license headers (Rust)
files: \.rs$
args:
- --license-filepath
- testing/utils/.license-header.txt
- --comment-style
- "//"
- id: insert-license
name: check license headers (CUDA)
files: \.(cu|cuh)$
args:
- --license-filepath
- testing/utils/.license-header.txt
- --comment-style
- "//"
# Rust Linter
- repo: https://github.com/doublify/pre-commit-rust
rev: v1.0
hooks:
- id: fmt
pass_filenames: false
args: ['--manifest-path', 'qdp/Cargo.toml', '--all']
- repo: local
hooks:
- id: clippy
name: cargo clippy
language: system
pass_filenames: false
entry: bash -c 'LIBTORCH_USE_PYTORCH=1 cargo clippy "$@"' --
args:
- --manifest-path
- qdp/Cargo.toml
- --all-targets
- --all-features
- --
- -D
- warnings