-
Notifications
You must be signed in to change notification settings - Fork 25
/
.pre-commit-config.yaml
91 lines (86 loc) · 2.55 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
80
81
82
83
84
85
86
87
88
89
90
91
# See https://pre-commit.com for more information
# pre-commit install
# pre-commit install --hook-type commit-msg
exclude: ^(LICENSE|LICENSE*)
repos:
- repo: local
hooks:
- id: fmt
name: fmt
description: Format rust files.
entry: cargo fmt
language: system
types: [rust]
args: ["--all", "--", "--check"]
- id: cargo-check
name: cargo check
description: Check the package for errors.
entry: cargo check --workspace
language: system
types: [rust]
pass_filenames: false
- id: clippy
name: clippy
description: Lint via clippy
entry: cargo clippy
language: system
args: ["--workspace", "--", "-D", "warnings"]
types: [rust]
pass_filenames: false
- id: docs
name: docs
description: Check docs for warnings.
entry: env RUSTDOCFLAGS=-Dwarnings cargo doc
language: system
args: ["--workspace", "--document-private-items"]
types: [rust]
pass_filenames: false
- id: cargo-hakari
name: workspace-hack
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
- repo: https://github.com/kamadorueda/alejandra
rev: bb7f2ad3f176aa8e9e2944a10061f7989c8fef17 # frozen: 1.3.0
hooks:
- id: alejandra
files: \.nix$
- repo: https://github.com/DevinR528/cargo-sort
rev: v1.0.9
hooks:
- id: cargo-sort
args: ["-w"]
- repo: https://github.com/ComPWA/mirrors-taplo
rev: v0.8.1
hooks:
- id: taplo
args: ["fmt"]
types:
- toml
exclude: homestar-workspace-hack/Cargo.toml
- repo: https://github.com/compilerla/conventional-pre-commit
rev: v2.1.1
hooks:
- id: conventional-pre-commit
stages:
- commit-msg
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
- id: no-commit-to-branch
args: ["-b", "main"]
- id: check-merge-conflict
- id: trailing-whitespace
exclude: bindings\.rs$
- id: end-of-file-fixer
exclude: \.(txt|json|patch)$
- id: check-yaml
- id: check-json
- id: check-added-large-files
args: ["--maxkb=4000"]
- id: detect-private-key
exclude: __testkey
- id: check-executables-have-shebangs
- id: check-toml