-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy path.pre-commit-config.yaml
48 lines (43 loc) · 1.63 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
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
# some configs are from https://github.com/rust-lang/cargo/issues/13758
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- repo: local
hooks:
- id: rustfmt
name: Rust fmt
description: Check if all files follow the rustfmt style
entry: cargo fmt --all -- --check --color always
language: system
pass_filenames: false
- repo: local
hooks:
- id: rust-linting
name: Rust linting
description: Run cargo fmt on files included in the commit. rustfmt should be installed before-hand.
entry: cargo fmt --all --
pass_filenames: true
types: [file, rust]
language: system
- id: rust-clippy
name: Rust clippy
description: Run cargo clippy on files included in the commit. clippy should be installed before-hand.
entry: cargo clippy --examples -- -D warnings
# strict check uncomment this
# entry: cargo clippy --all-targets --all-features -- -Dclippy::all
pass_filenames: false
types: [file, rust]
language: system
- repo: https://github.com/crate-ci/typos
rev: typos-dict-v0.11.35
hooks:
- id: typos
name: Typo Check
description: Run typos to check typo.