-
Notifications
You must be signed in to change notification settings - Fork 44
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
74 lines (74 loc) · 2.2 KB
/
.pre-commit-config.yaml
File metadata and controls
74 lines (74 loc) · 2.2 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
# Exclude all 3rd-party libraries
exclude: |
(?x)^(
third_party/.+
)$
repos:
# Common hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-added-large-files
- id: check-merge-conflict
- id: check-symlinks
- id: detect-private-key
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/Lucas-C/pre-commit-hooks.git
rev: v1.5.5
hooks:
- id: remove-crlf
- id: remove-tabs
name: Tabs remover (C++)
files: \.(c|cc|cxx|cpp|cu|h|cuh|hpp|hxx|xpu|kps)$
args: [--whitespaces-count, '2']
- id: remove-tabs
name: Tabs remover (Python)
files: (.*\.py)$
args: [--whitespaces-count, '4']
- id: insert-license # Insert a short license disclaimer as a header comment in Python files
name: License inserter (Python)
files: \.py$
args:
- --license-filepath
- LICENSE
- --comment-style
- "#"
- --use-current-year
- --no-extra-eol
- id: insert-license # Insert a short license disclaimer as a header comment in C++ files
name: License inserter (C++)
files: \.(c|cc|cxx|cpp|cu|h|cuh|hpp|hxx|xpu|kps)$
args:
- --license-filepath
- LICENSE
- --comment-style
- "//"
- --use-current-year
- --no-extra-eol
# For Python files
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 25.1.0
hooks:
- id: black
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.12.0
hooks:
- id: ruff-check
args: [--fix, --exit-non-zero-on-fix, --no-cache, --config=tools/codestyle/pyproject.toml]
# For C++ files
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v20.1.8
hooks:
- id: clang-format
types_or: [c++, cuda]
args: [--style=file, --verbose]
- repo: https://github.com/cheshirekow/cmake-format-precommit
rev: v0.6.13
hooks:
- id: cmake-format
- repo: https://github.com/PFCCLab/cmake-lint-paddle
rev: v1.5.2
hooks:
- id: cmakelint
args: [--config=./tools/codestyle/.cmakelintrc]