From 63e533e523900181fed177c5bbef4b372e8335aa Mon Sep 17 00:00:00 2001 From: Dreaded_X Date: Thu, 13 Mar 2025 03:29:11 +0100 Subject: [PATCH] Add pre-commit --- .pre-commit-config.yaml | 43 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .pre-commit-config.yaml 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