forked from xline-kv/Xline
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.pre-commit-config.yaml
79 lines (79 loc) · 2.61 KB
/
.pre-commit-config.yaml
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
fail_fast: false
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: no-commit-to-branch
- id: check-byte-order-marker
- id: check-case-conflict
- id: check-merge-conflict
- id: check-symlinks
- id: check-yaml
- id: check-toml
- id: end-of-file-fixer
- id: mixed-line-ending
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 23.3.0
hooks:
- id: black
- repo: https://github.com/crate-ci/typos
rev: v1.16.0
hooks:
- id: typos
- repo: local
hooks:
- id: cargo-fmt
name: cargo fmt
description: Format files with rustfmt.
entry: bash -c 'cargo fmt -- --check'
language: rust
files: ^(?!abi)\.rs$
args: [ ]
- id: cargo-check
name: cargo check
description: Check the package for errors.
entry: bash -c 'cargo check --all'
language: rust
files: \.rs$
pass_filenames: false
- id: cargo-clippy
name: cargo clippy
description: Lint rust sources
entry: bash -c 'cargo clippy --all-targets --all-features --tests --benches -- -D warnings'
language: rust
files: \.rs$
pass_filenames: false
- id: cargo-test
name: cargo test
description: unit test for the project
entry: bash -c 'cargo test --all-features --all --lib'
language: rust
files: \.rs$
pass_filenames: false
- id: conventional-commit-msg-validation
name: commit message conventional validation
language: pygrep
entry: '^(breaking|build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test){1}(\([\w\-\.]+\))?(!)?: ([\w `])+([\s\S]*)'
args: [ --multiline, --negate ]
stages: [ commit-msg ]
- id: commit-msg-needs-to-be-signed-off
name: commit message needs to be signed off
language: pygrep
entry: '^Signed-off-by:'
args: [ --multiline, --negate ]
stages: [ commit-msg ]
- id: cargo-sort
name: Check Cargo.toml is sorted
description: Ensure Cargo.toml is sorted
entry: bash -c 'cargo sort --workspace'
language: rust
files: Cargo\.toml
pass_filenames: false
- id: cargo-hakari
name: Check if workspace-hack works correctly
description: Ensure workspace-hack works correctly
entry: bash -c 'cargo hakari generate --diff && cargo hakari manage-deps --dry-run && cargo hakari verify'
language: rust
files: Cargo\.(toml|lock)
pass_filenames: false