From 6300473e011094ea32eb195408a344e955c6cccb Mon Sep 17 00:00:00 2001 From: Antonio Hickey <64357439+antonio-hickey@users.noreply.github.com> Date: Fri, 10 Jun 2022 22:27:29 -0400 Subject: [PATCH 1/6] docs: add clippy hook to example Makes it easier for the user to know how to set up all the hooks available. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 12d3b83..6696209 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ hooks: - id: fmt - id: cargo-check + - id: cargo-clippy ``` ## Passing arguments to rustfmt From f70890bae99b7cfb374c1325771d43a9788f54f0 Mon Sep 17 00:00:00 2001 From: Antonio Hickey <64357439+antonio-hickey@users.noreply.github.com> Date: Fri, 10 Jun 2022 22:31:55 -0400 Subject: [PATCH 2/6] fix: typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6696209..6a99c12 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ hooks: - id: fmt - id: cargo-check - - id: cargo-clippy + - id: clippy ``` ## Passing arguments to rustfmt From e73537758e912f937986096cd108bd3cb9da1e05 Mon Sep 17 00:00:00 2001 From: Antonio Hickey Date: Sat, 3 Aug 2024 17:34:46 -0400 Subject: [PATCH 3/6] chore: bump pre-commit versions --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 From bc1f275495e6db1bd67c476b138c72b366457508 Mon Sep 17 00:00:00 2001 From: Antonio Hickey Date: Sat, 3 Aug 2024 18:06:10 -0400 Subject: [PATCH 4/6] feat: add cargo build & test hooks --- .pre-commit-hooks.yaml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml index 0ffe38d..d4af11c 100644 --- a/.pre-commit-hooks.yaml +++ b/.pre-commit-hooks.yaml @@ -20,3 +20,17 @@ 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", "--", "--nocapture", "--test-threads=1", "--test"] +- id: build + name: build + description: Build using cargo build + language: system + types: ["rust"] + entry: cargo build + pass_filenames: false From a46872ce00a9796ca70ef72e94246218925c381e Mon Sep 17 00:00:00 2001 From: Antonio Hickey Date: Sat, 3 Aug 2024 19:12:16 -0400 Subject: [PATCH 5/6] docs: update readme --- README.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 6a99c12..99327f7 100644 --- a/README.md +++ b/README.md @@ -2,23 +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', '--'] ``` From 2d8e69427597fa65c6a7773e8ebbb1a8ce82bce6 Mon Sep 17 00:00:00 2001 From: Antonio Hickey Date: Sat, 3 Aug 2024 19:23:46 -0400 Subject: [PATCH 6/6] fix: cargo test pre commit hook --- .pre-commit-hooks.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml index d4af11c..ed5928a 100644 --- a/.pre-commit-hooks.yaml +++ b/.pre-commit-hooks.yaml @@ -26,7 +26,8 @@ entry: cargo test language: system types: [rust] - args: ["--all-targets", "--", "--nocapture", "--test-threads=1", "--test"] + args: ["--all-targets"] + pass_filenames: false - id: build name: build description: Build using cargo build