|
1 | 1 | # See https://pre-commit.com for more information
|
2 | 2 | # See https://pre-commit.com/hooks.html for more hooks
|
3 | 3 | repos:
|
4 |
| -- repo: https://github.com/pre-commit/pre-commit-hooks |
| 4 | + - repo: https://github.com/pre-commit/pre-commit-hooks |
5 | 5 | rev: v4.5.0
|
6 | 6 | hooks:
|
7 |
| - - id: trailing-whitespace |
| 7 | + - id: trailing-whitespace |
8 | 8 | exclude: "^.+\\.pbtxt$"
|
9 |
| - - id: end-of-file-fixer |
| 9 | + - id: end-of-file-fixer |
10 | 10 | exclude: "^.+\\.pbtxt$"
|
11 |
| - - id: check-yaml |
12 |
| - - id: check-json |
13 |
| - - id: check-added-large-files |
14 |
| - args: ['--maxkb=1024', '--enforce-all'] |
15 |
| - # TODO: remove the following after resolved |
| 11 | + - id: check-yaml |
| 12 | + - id: check-json |
| 13 | + - id: check-added-large-files |
| 14 | + args: ["--maxkb=1024", "--enforce-all"] |
16 | 15 | exclude: |
|
17 |
| - (?x)^( |
18 |
| - source/tests/infer/dipolecharge_e.pbtxt| |
19 |
| - source/tests/infer/deeppolar_new.pbtxt |
20 |
| - )$ |
21 |
| - - id: check-merge-conflict |
22 |
| - - id: check-symlinks |
23 |
| - - id: check-toml |
24 |
| -# Python |
25 |
| -- repo: https://github.com/PyCQA/isort |
| 16 | + (?x)^( |
| 17 | + source/tests/infer/dipolecharge_e.pbtxt| |
| 18 | + source/tests/infer/deeppolar_new.pbtxt |
| 19 | + )$ |
| 20 | + - id: check-merge-conflict |
| 21 | + - id: check-symlinks |
| 22 | + - id: check-toml |
| 23 | + # Python |
| 24 | + - repo: https://github.com/PyCQA/isort |
26 | 25 | rev: 5.13.2
|
27 | 26 | hooks:
|
28 |
| - - id: isort |
29 |
| - files: \.py$ |
30 |
| - exclude: ^source/3rdparty |
31 |
| -- repo: https://github.com/astral-sh/ruff-pre-commit |
| 27 | + - id: isort |
| 28 | + files: \.py$ |
| 29 | + exclude: ^source/3rdparty |
| 30 | + - repo: https://github.com/astral-sh/ruff-pre-commit |
32 | 31 | # Ruff version.
|
33 | 32 | rev: v0.3.3
|
34 | 33 | hooks:
|
35 |
| - - id: ruff |
36 |
| - args: ["--fix"] |
37 |
| - exclude: ^source/3rdparty |
38 |
| - types_or: [python, pyi, jupyter] |
39 |
| - - id: ruff-format |
40 |
| - exclude: ^source/3rdparty |
41 |
| - types_or: [python, pyi, jupyter] |
42 |
| -# numpydoc |
43 |
| -- repo: https://github.com/Carreau/velin |
| 34 | + - id: ruff |
| 35 | + args: ["--fix"] |
| 36 | + exclude: ^source/3rdparty |
| 37 | + types_or: [python, pyi, jupyter] |
| 38 | + - id: ruff-format |
| 39 | + exclude: ^source/3rdparty |
| 40 | + types_or: [python, pyi, jupyter] |
| 41 | + # numpydoc |
| 42 | + - repo: https://github.com/Carreau/velin |
44 | 43 | rev: 0.0.12
|
45 | 44 | hooks:
|
46 |
| - - id: velin |
47 |
| - args: ["--write"] |
48 |
| - exclude: ^source/3rdparty |
49 |
| -# Python inside docs |
50 |
| -- repo: https://github.com/asottile/blacken-docs |
| 45 | + - id: velin |
| 46 | + args: ["--write"] |
| 47 | + exclude: ^source/3rdparty |
| 48 | + # Python inside docs |
| 49 | + - repo: https://github.com/asottile/blacken-docs |
51 | 50 | rev: 1.16.0
|
52 | 51 | hooks:
|
53 |
| - - id: blacken-docs |
54 |
| -# C++ |
55 |
| -- repo: https://github.com/pre-commit/mirrors-clang-format |
| 52 | + - id: blacken-docs |
| 53 | + # C++ |
| 54 | + - repo: https://github.com/pre-commit/mirrors-clang-format |
56 | 55 | rev: v18.1.1
|
57 | 56 | hooks:
|
58 |
| - - id: clang-format |
| 57 | + - id: clang-format |
59 | 58 | exclude: ^source/3rdparty|source/lib/src/gpu/cudart/.+\.inc
|
60 |
| -# CSS |
61 |
| -- repo: https://github.com/pre-commit/mirrors-csslint |
62 |
| - rev: v1.0.5 |
| 59 | + # markdown, yaml, CSS, javascript |
| 60 | + - repo: https://github.com/pre-commit/mirrors-prettier |
| 61 | + rev: v4.0.0-alpha.8 |
| 62 | + hooks: |
| 63 | + - id: prettier |
| 64 | + types_or: [markdown, yaml, css] |
| 65 | + # workflow files cannot be modified by pre-commit.ci |
| 66 | + exclude: ^(source/3rdparty|\.github/workflows|\.clang-format) |
| 67 | + # Shell |
| 68 | + - repo: https://github.com/scop/pre-commit-shfmt |
| 69 | + rev: v3.8.0-1 |
| 70 | + hooks: |
| 71 | + - id: shfmt |
| 72 | + # CMake |
| 73 | + - repo: https://github.com/cheshirekow/cmake-format-precommit |
| 74 | + rev: v0.6.13 |
| 75 | + hooks: |
| 76 | + - id: cmake-format |
| 77 | + #- id: cmake-lint |
| 78 | + # license header |
| 79 | + - repo: https://github.com/Lucas-C/pre-commit-hooks |
| 80 | + rev: v1.5.5 |
63 | 81 | hooks:
|
64 |
| - - id: csslint |
65 |
| -# Shell |
66 |
| -- repo: https://github.com/scop/pre-commit-shfmt |
67 |
| - rev: v3.8.0-1 |
68 |
| - hooks: |
69 |
| - - id: shfmt |
70 |
| -# CMake |
71 |
| -- repo: https://github.com/cheshirekow/cmake-format-precommit |
72 |
| - rev: v0.6.13 |
73 |
| - hooks: |
74 |
| - - id: cmake-format |
75 |
| - #- id: cmake-lint |
76 |
| -# license header |
77 |
| -- repo: https://github.com/Lucas-C/pre-commit-hooks |
78 |
| - rev: v1.5.5 |
79 |
| - hooks: |
80 |
| - # C++, js |
81 |
| - - id: insert-license |
| 82 | + # C++, js |
| 83 | + - id: insert-license |
82 | 84 | files: \.(c|cc|cpp|js|ts|h|hpp)$
|
83 | 85 | args:
|
84 |
| - - --license-filepath |
85 |
| - - .license-header.txt |
86 |
| - - --comment-style |
87 |
| - - // |
88 |
| - - --no-extra-eol |
| 86 | + - --license-filepath |
| 87 | + - .license-header.txt |
| 88 | + - --comment-style |
| 89 | + - // |
| 90 | + - --no-extra-eol |
89 | 91 | exclude: ^source/3rdparty|source/lib/src/gpu/cudart/.+\.inc
|
90 |
| - # CSS |
91 |
| - - id: insert-license |
| 92 | + # CSS |
| 93 | + - id: insert-license |
92 | 94 | files: \.(css|scss)$
|
93 | 95 | args:
|
94 |
| - - --license-filepath |
95 |
| - - .license-header.txt |
96 |
| - - --comment-style |
97 |
| - - /*| *| */ |
98 |
| - - --no-extra-eol |
99 |
| - # Python |
100 |
| - - id: insert-license |
| 96 | + - --license-filepath |
| 97 | + - .license-header.txt |
| 98 | + - --comment-style |
| 99 | + - /*| *| */ |
| 100 | + - --no-extra-eol |
| 101 | + # Python |
| 102 | + - id: insert-license |
101 | 103 | files: \.(py|pyx)$
|
102 | 104 | args:
|
103 |
| - - --license-filepath |
104 |
| - - .license-header.txt |
105 |
| - - --comment-style |
106 |
| - - "#" |
107 |
| - - --no-extra-eol |
| 105 | + - --license-filepath |
| 106 | + - .license-header.txt |
| 107 | + - --comment-style |
| 108 | + - "#" |
| 109 | + - --no-extra-eol |
108 | 110 | exclude: ^source/3rdparty
|
109 |
| - # HTML |
110 |
| - - id: insert-license |
| 111 | + # HTML |
| 112 | + - id: insert-license |
111 | 113 | files: \.(html|vue|xml)$
|
112 | 114 | args:
|
113 |
| - - --license-filepath |
114 |
| - - .license-header.txt |
115 |
| - - --comment-style |
116 |
| - - <!--| ~| --> |
117 |
| - - --no-extra-eol |
| 115 | + - --license-filepath |
| 116 | + - .license-header.txt |
| 117 | + - --comment-style |
| 118 | + - <!--| ~| --> |
| 119 | + - --no-extra-eol |
118 | 120 | ci:
|
119 | 121 | autoupdate_branch: devel
|
0 commit comments