-
Notifications
You must be signed in to change notification settings - Fork 107
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
71 lines (66 loc) · 2.5 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
71 lines (66 loc) · 2.5 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
exclude: '\.m$|\.mw$|\.doc$|\.docbit$|\.docsrc$|\.rst$'
repos:
# --- C / C++ / CUDA: staged hunks only via git-clang-format ---
# Uses a wrapper script to work around git-clang-format's fixed temp-index
# path (.git/clang-format-index) which causes stale .lock files when the
# pre-commit framework's concurrent git operations race with it.
- repo: local
hooks:
- id: clang-format-staged
name: clang-format (staged hunks)
entry: python tools/clang-format-staged.py
language: python
additional_dependencies: [clang-format==22.*]
pass_filenames: true
require_serial: true
types_or: [c++, c, cuda]
files: \.(c|cc|cpp|h|hpp|cu|cuh)$
exclude: '(^|/)(matlab/.*)$'
- id: gersemi-staged
name: gersemi (staged hunks)
entry: python tools/gersemi-staged.py
language: python
additional_dependencies: [gersemi==0.28.1]
pass_filenames: true
require_serial: true
files: '(^|/)(CMakeLists\.txt|[^/]+\.cmake(?:\.in)?)$'
# --- Python ---
- repo: https://github.com/akaihola/darker
rev: v3.0.0
hooks:
- id: darker
args: [--formatter=ruff]
# tomli: darker's ruff formatter imports it on Python < 3.11 but never
# declares it, so the hook fails to import there without this.
additional_dependencies: [ruff==0.16.4, 'tomli; python_version < "3.11"']
# Keep this in step with ruff.toml: darker calls ruff with
# --stdin-filename=<basename>, so ruff's own path excludes never match here.
exclude: '^(deps/|devel/|tutorial/poisson2dnuquad\.py$|perftest/spreadbenchmark\.py$)'
# --- Shell ---
- repo: https://github.com/scop/pre-commit-shfmt
rev: v3.13.1-1
hooks:
- id: shfmt
# --- Standard file hygiene ---
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- id: check-illegal-windows-names
- id: mixed-line-ending
# --- Python package validation ---
- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.25
hooks:
- id: validate-pyproject
additional_dependencies: ["validate-pyproject-schema-store[all]"]
files: ^python/(finufft|cufinufft)/pyproject\.toml$
# --- Jenkinsfile ---
- repo: https://github.com/nvuillam/npm-groovy-lint
rev: v18.0.0
hooks:
- id: npm-groovy-lint
args: [--failon, error]
files: (^|/)Jenkinsfile$