Skip to content

Commit b92d855

Browse files
committed
Add .pre-commit-config.yaml
1 parent 5257d2d commit b92d855

File tree

3 files changed

+50
-1
lines changed

3 files changed

+50
-1
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
components: rustfmt
4646
- uses: Swatinem/rust-cache@v2
4747
- name: Enforce formatting
48-
run: cargo fmt -- --check --color always
48+
run: cargo fmt --all -- --check --color always
4949

5050
msrv:
5151
name: MSRV check

.pre-commit-config.yaml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
repos:
2+
3+
- repo: local
4+
hooks:
5+
- id: check
6+
name: check
7+
description: Standard check
8+
entry: cargo check
9+
language: system
10+
types: [ rust ]
11+
pass_filenames: false
12+
13+
- id: clippy
14+
name: clippy
15+
description: More rigorous check
16+
entry: cargo clippy --all-targets --all-features -- -D warnings
17+
language: rust
18+
pass_filenames: false
19+
20+
- id: rustfmt
21+
name: rustfmt
22+
description: Check if all files follow the rustfmt style
23+
entry: cargo fmt --all -- --check --color always
24+
language: rust
25+
types: [ rust ]
26+
pass_filenames: false
27+
28+
- id: test
29+
name: test
30+
description: Run tests
31+
entry: cargo test --all --all-targets
32+
language: rust
33+
types: [ rust ]
34+
pass_filenames: false
35+
36+
- repo: https://github.com/EmbarkStudios/cargo-deny
37+
rev: 0.18.5
38+
hooks:
39+
- id: cargo-deny
40+
args: ["--all-features", "check"]
41+
42+
- repo: https://github.com/pre-commit/pre-commit-hooks
43+
rev: v3.2.0
44+
hooks:
45+
- id: check-added-large-files
46+
- id: check-yaml
47+
- id: end-of-file-fixer
48+
- id: trailing-whitespace

deny.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ targets = [
3636
"x86_64-apple-darwin",
3737
"universal-apple-darwin",
3838
"x86_64-pc-windows-msvc",
39+
"x86_64-unknown-linux-musl",
3940
]
4041
# When creating the dependency graph used as the source of truth when checks are
4142
# executed, this field can be used to prune crates from the graph, removing them

0 commit comments

Comments
 (0)