diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2b032e0..15a2476 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v3.1.0 + rev: v4.5.0 hooks: - id: check-byte-order-marker - id: check-case-conflict @@ -11,6 +11,6 @@ repos: - id: mixed-line-ending - id: trailing-whitespace - repo: https://github.com/pre-commit/pre-commit - rev: v2.5.1 + rev: v3.6.2 hooks: - id: validate_manifest diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml index 0ffe38d..ed5928a 100644 --- a/.pre-commit-hooks.yaml +++ b/.pre-commit-hooks.yaml @@ -20,3 +20,18 @@ args: ["--", "-D", "warnings"] types: [rust] pass_filenames: false +- id: test + name: test + description: Run tests with cargo test + entry: cargo test + language: system + types: [rust] + args: ["--all-targets"] + pass_filenames: false +- id: build + name: build + description: Build using cargo build + language: system + types: ["rust"] + entry: cargo build + pass_filenames: false diff --git a/README.md b/README.md index 12d3b83..99327f7 100644 --- a/README.md +++ b/README.md @@ -2,22 +2,27 @@ [Rust](https://www.rust-lang.org) tools package for [pre-commit](https://pre-commit.com). +Forked from: [doublify's pre-commit-rust](https://github.com/doublify/pre-commit-rust) (**NOTE: Their repo is unmaintained**) + ## Using rust tools with pre-commit ```yaml -- repo: https://github.com/doublify/pre-commit-rust +- repo: https://github.com/antonio-hickey/rusted-pre-commits rev: master hooks: - id: fmt - id: cargo-check + - id: clippy + - id: build + - id: test ``` ## Passing arguments to rustfmt ```yaml -- repo: https://github.com/doublify/pre-commit-rust +- repo: https://github.com/antonio-hickey/rusted-pre-commits rev: master hooks: - id: fmt - args: ['--verbose', '--edition', '2018', '--'] + args: ['--verbose', '--edition', '2021', '--'] ```