-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
70 lines (64 loc) · 1.75 KB
/
.pre-commit-config.yaml
File metadata and controls
70 lines (64 loc) · 1.75 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
# Pre-commit hooks configuration
# Install: pip install pre-commit
# Setup: pre-commit install
# Run manually: pre-commit run --all-files
repos:
# General file checks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
exclude: '\.lock$'
- id: end-of-file-fixer
exclude: '\.lock$'
- id: check-yaml
args: ['--unsafe'] # Allow custom YAML tags
- id: check-json
- id: check-toml
- id: check-added-large-files
args: ['--maxkb=1000']
- id: check-merge-conflict
- id: check-case-conflict
- id: mixed-line-ending
args: ['--fix=lf']
# Markdown linting
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.42.0
hooks:
- id: markdownlint
args: ['--fix']
# Rust formatting
- repo: local
hooks:
- id: cargo-fmt
name: cargo fmt
entry: cargo fmt
language: system
types: [rust]
pass_filenames: false
# Rust linting
- repo: local
hooks:
- id: cargo-clippy
name: cargo clippy
entry: cargo clippy
args: ['--all-targets', '--all-features', '--', '-D', 'warnings']
language: system
types: [rust]
pass_filenames: false
# Rust security audit (optional - can be slow)
- repo: local
hooks:
- id: cargo-check
name: cargo check
entry: cargo check
args: ['--all-targets', '--all-features']
language: system
types: [rust]
pass_filenames: false
# TOML sorting and formatting
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
rev: v2.14.0
hooks:
- id: pretty-format-toml
args: ['--autofix']