-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
95 lines (87 loc) · 2.72 KB
/
.pre-commit-config.yaml
File metadata and controls
95 lines (87 loc) · 2.72 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
86
87
88
89
90
91
92
93
94
95
# Pre-commit hooks for rust-dashcore
# See CONTRIBUTING.md for instructions on how to install and use
# And https://pre-commit.com for more information
repos:
# ============================================================================
# FAST CHECKS - Run on every commit.
# ============================================================================
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: trailing-whitespace
exclude: '\.md$' # Allow trailing spaces in markdown for line breaks
- id: end-of-file-fixer
exclude: |
(?x)^(
.*\.snap$|
.*/tests/data/.*|
fuzz/hfuzz_input/.*
)$
- id: check-yaml
args: ['--allow-multiple-documents']
- id: check-json
- id: check-toml
- id: check-merge-conflict
- id: mixed-line-ending
args: ['--fix=lf']
- id: check-added-large-files
args: ['--maxkb=1000']
- id: check-case-conflict
- id: check-executables-have-shebangs
- id: check-shebang-scripts-are-executable
exclude: '\.rs$' # Rust inner attributes (#![...]) look like shebangs
- repo: https://github.com/rhysd/actionlint
rev: v1.7.9
hooks:
- id: actionlint
- repo: https://github.com/crate-ci/typos
rev: v1.40.0
hooks:
- id: typos
args: ['--write-changes']
exclude: |
(?x)^(
.*\.snap$|
.*\.lock$|
CHANGELOG\.md|
dash/tests/data/.*|
key-wallet/tests/data/.*|
fuzz/hfuzz_input/.*
)$
- repo: local
hooks:
- id: cargo-fmt
name: cargo fmt
description: Format Rust code with rustfmt
entry: cargo fmt --all
language: system
types: [rust]
pass_filenames: false
- id: verify-ffi
name: verify FFI
description: Verify FFI documentation is up to date
entry: contrib/verify_ffi.py
language: python
pass_filenames: false
files: ^(key-wallet-ffi|dash-spv-ffi)/.*\.(rs|toml|py)$
# ============================================================================
# SLOW CHECKS - Run on git push only.
# ============================================================================
- repo: local
hooks:
- id: clippy
name: clippy (workspace strict)
description: Strict clippy on entire workspace - deny all warnings
entry: python3 contrib/run_clippy.py
language: system
types: [rust]
pass_filenames: false
stages: [pre-push, manual]
exclude: |
(?x)^(
.*\.snap$|
target/|
.*/target/|
\.cargo/|
\.git/
)$