Add pre-commit
This commit is contained in:
parent
729f1483c9
commit
63e533e523
43
.pre-commit-config.yaml
Normal file
43
.pre-commit-config.yaml
Normal file
|
@ -0,0 +1,43 @@
|
|||
repos:
|
||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||
rev: v4.6.0
|
||||
hooks:
|
||||
- id: trailing-whitespace
|
||||
- id: end-of-file-fixer
|
||||
- id: check-toml
|
||||
- id: check-added-large-files
|
||||
- id: check-merge-conflict
|
||||
|
||||
- repo: https://github.com/crate-ci/typos
|
||||
rev: v1.21.0
|
||||
hooks:
|
||||
- id: typos
|
||||
args: ["--force-exclude"]
|
||||
|
||||
- repo: local
|
||||
hooks:
|
||||
- id: fmt
|
||||
name: fmt
|
||||
description: Format files with cargo fmt.
|
||||
entry: cargo fmt
|
||||
language: system
|
||||
types: [rust]
|
||||
args: ["--", "--check"]
|
||||
|
||||
- id: clippy
|
||||
name: clippy
|
||||
description: Lint rust sources
|
||||
entry: cargo clippy
|
||||
language: system
|
||||
args: ["--", "-D", "warnings"]
|
||||
types: [rust]
|
||||
pass_filenames: false
|
||||
|
||||
- id: test
|
||||
name: test
|
||||
description: Rust test
|
||||
entry: cargo test
|
||||
language: system
|
||||
args: ["--workspace"]
|
||||
types: [rust]
|
||||
pass_filenames: false
|
Loading…
Reference in New Issue
Block a user