2024-08-08 15:58:56 +08:00
|
|
|
fail_fast: false
|
|
|
|
repos:
|
|
|
|
- repo: https://gitea.joylink.club/pre-commit/pre-commit-hooks
|
|
|
|
rev: v4.3.0
|
|
|
|
hooks:
|
|
|
|
- id: check-byte-order-marker
|
|
|
|
- id: check-case-conflict
|
|
|
|
- id: check-merge-conflict
|
|
|
|
- id: check-symlinks
|
|
|
|
- id: check-yaml
|
|
|
|
- id: end-of-file-fixer
|
|
|
|
- id: mixed-line-ending
|
|
|
|
- id: trailing-whitespace
|
|
|
|
- repo: local
|
|
|
|
hooks:
|
|
|
|
- id: cargo-fmt
|
|
|
|
name: cargo fmt
|
|
|
|
description: Format files with rustfmt.
|
|
|
|
entry: bash -c 'cargo fmt -- --check'
|
|
|
|
language: rust
|
|
|
|
files: \.rs$
|
|
|
|
args: []
|
|
|
|
- id: typos
|
|
|
|
name: typos
|
|
|
|
description: check typo
|
|
|
|
entry: bash -c 'typos'
|
|
|
|
language: rust
|
|
|
|
files: \.*$
|
|
|
|
pass_filenames: false
|
|
|
|
- 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
|
2024-09-14 17:05:57 +08:00
|
|
|
entry: bash -c 'cargo nextest run --workspace --all-features'
|
2024-08-08 15:58:56 +08:00
|
|
|
language: rust
|
|
|
|
files: \.rs$
|
|
|
|
pass_filenames: false
|