forked from deepmodeling/deepmd-kit
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.pre-commit-config.yaml
119 lines (119 loc) · 3.02 KB
/
.pre-commit-config.yaml
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
119
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace
exclude: "^.+\\.pbtxt$"
- id: end-of-file-fixer
exclude: "^.+\\.pbtxt$"
- id: check-yaml
- id: check-json
- id: check-added-large-files
args: ['--maxkb=1024', '--enforce-all']
# TODO: remove the following after resolved
exclude: |
(?x)^(
source/tests/infer/dipolecharge_e.pbtxt|
source/tests/infer/deeppolar_new.pbtxt
)$
- id: check-merge-conflict
- id: check-symlinks
- id: check-toml
# Python
- repo: https://github.com/PyCQA/isort
rev: 5.13.2
hooks:
- id: isort
files: \.py$
exclude: ^source/3rdparty
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.1.13
hooks:
- id: ruff
args: ["--fix"]
exclude: ^source/3rdparty
types_or: [python, pyi, jupyter]
- id: ruff-format
exclude: ^source/3rdparty
types_or: [python, pyi, jupyter]
# numpydoc
- repo: https://github.com/Carreau/velin
rev: 0.0.12
hooks:
- id: velin
args: ["--write"]
exclude: ^source/3rdparty
# Python inside docs
- repo: https://github.com/asottile/blacken-docs
rev: 1.16.0
hooks:
- id: blacken-docs
# C++
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v17.0.6
hooks:
- id: clang-format
exclude: ^source/3rdparty|source/lib/src/gpu/cudart/.+\.inc
# CSS
- repo: https://github.com/pre-commit/mirrors-csslint
rev: v1.0.5
hooks:
- id: csslint
# Shell
- repo: https://github.com/scop/pre-commit-shfmt
rev: v3.7.0-4
hooks:
- id: shfmt
# CMake
- repo: https://github.com/cheshirekow/cmake-format-precommit
rev: v0.6.13
hooks:
- id: cmake-format
#- id: cmake-lint
# license header
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.4
hooks:
# C++, js
- id: insert-license
files: \.(c|cc|cpp|js|ts|h|hpp)$
args:
- --license-filepath
- .license-header.txt
- --comment-style
- //
- --no-extra-eol
exclude: ^source/3rdparty|source/lib/src/gpu/cudart/.+\.inc
# CSS
- id: insert-license
files: \.(css|scss)$
args:
- --license-filepath
- .license-header.txt
- --comment-style
- /*| *| */
- --no-extra-eol
# Python
- id: insert-license
files: \.(py|pyx)$
args:
- --license-filepath
- .license-header.txt
- --comment-style
- "#"
- --no-extra-eol
exclude: ^source/3rdparty
# HTML
- id: insert-license
files: \.(html|vue|xml)$
args:
- --license-filepath
- .license-header.txt
- --comment-style
- <!--| ~| -->
- --no-extra-eol
ci:
autoupdate_branch: devel