diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..99a785f --- /dev/null +++ b/.pre-commit-config.yaml @@ -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