build: add pre-commit config and typo config
This commit is contained in:
56
.pre-commit-config.yaml
Normal file
56
.pre-commit-config.yaml
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
|
||||||
|
fail_fast: false
|
||||||
|
repos:
|
||||||
|
- repo: https://github.com/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
|
||||||
|
exclude: (config/.*)
|
||||||
|
- id: end-of-file-fixer
|
||||||
|
- id: mixed-line-ending
|
||||||
|
- id: trailing-whitespace
|
||||||
|
- repo: https://github.com/psf/black
|
||||||
|
rev: 22.10.0
|
||||||
|
hooks:
|
||||||
|
- id: black
|
||||||
|
- 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
|
||||||
|
entry: bash -c 'cargo nextest run --all-features'
|
||||||
|
language: rust
|
||||||
|
files: \.rs$
|
||||||
|
pass_filenames: false
|
||||||
1
_typos.toml
Normal file
1
_typos.toml
Normal file
@@ -0,0 +1 @@
|
|||||||
|
[default.extend-words]
|
||||||
Reference in New Issue
Block a user