-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
152 lines (135 loc) · 3.57 KB
/
.pre-commit-config.yaml
File metadata and controls
152 lines (135 loc) · 3.57 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
# Pre-commit hooks configuration for REChain SDK
# Install with: pip install pre-commit && pre-commit install
repos:
# Rust formatting
- repo: local
hooks:
- id: rust-fmt
name: Rust Format
entry: cargo fmt --all
language: system
files: \.(rs|toml)$
pass_filenames: false
# Rust clippy
- repo: local
hooks:
- id: rust-clippy
name: Rust Clippy
entry: cargo clippy --workspace --all-targets -- -D warnings
language: system
files: \.(rs|toml)$
pass_filenames: false
# Rust tests
- repo: local
hooks:
- id: rust-test
name: Rust Tests
entry: cargo test --workspace
language: system
files: \.(rs|toml)$
pass_filenames: false
# Check for security vulnerabilities
- repo: https://github.com/rust-lang/cargo-audit.git
rev: v0.18.0
hooks:
- id: cargo-audit
name: Cargo Audit
entry: cargo audit
language: system
files: Cargo.lock
pass_filenames: false
# TOML formatting
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
rev: v2.11.0
hooks:
- id: pretty-format-toml
name: Pretty Format TOML
entry: pretty-format-toml
language: system
files: \.(toml)$
# YAML formatting
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.0
hooks:
- id: prettier
name: Prettier
entry: prettier --write
language: system
files: \.(yml|yaml)$
# Markdown formatting
- repo: https://github.com/executablebooks/mdformat
rev: 0.7.17
hooks:
- id: mdformat
name: MD Format
entry: mdformat
language: system
files: \.(md)$
additional_dependencies:
- mdformat-gfm
- mdformat-tables
- mdformat-toc
# Check for large files
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-added-large-files
name: Check Added Large Files
entry: check-added-large-files
language: system
- id: check-merge-conflict
name: Check Merge Conflict
entry: check-merge-conflict
language: system
- id: check-yaml
name: Check YAML
entry: check-yaml
language: system
files: \.(yml|yaml)$
- id: check-toml
name: Check TOML
entry: check-toml
language: system
files: \.(toml)$
- id: check-json
name: Check JSON
entry: check-json
language: system
files: \.(json)$
- id: end-of-file-fixer
name: End of File Fixer
entry: end-of-file-fixer
language: system
exclude: ^target/.*$
- id: trailing-whitespace
name: Trailing Whitespace
entry: trailing-whitespace
language: system
exclude: ^target/.*$
# Shell script linting
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.9.0.5
hooks:
- id: shellcheck
name: Shellcheck
entry: shellcheck
language: system
files: \.(sh)$
# License header check
- repo: local
hooks:
- id: license-header
name: License Header
entry: scripts/check-license-header.sh
language: system
files: \.(rs|ts|js|py)$
pass_filenames: true
# Security scan
- repo: local
hooks:
- id: security-scan
name: Security Scan
entry: cargo audit
language: system
files: Cargo.lock
pass_filenames: false