From 081eb6c9ab7053d552fa4588477fa7c643ac74be Mon Sep 17 00:00:00 2001 From: Nick Groenen Date: Sun, 16 Jan 2022 17:06:52 +0100 Subject: [PATCH] Simplify pre-commit setup No need to depend on a third-party hook repository when each of these checks is easily defined and run through system commands. This also allows us to actually run tests, which is current unsupported (https://github.com/doublify/pre-commit-rust/pull/19) --- .pre-commit-config.yaml | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d733744..3bf09f4 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,15 +5,25 @@ repos: rev: 9136088a246768144165fcc3ecc3d31bb686920a # frozen: v3.3.0 hooks: - id: check-yaml - - repo: https://github.com/doublify/pre-commit-rust - rev: eeee35a89e69d5772bdee97db1a6a898467b686e # frozen: v1.0 - hooks: - - id: fmt - - id: cargo-check - - id: clippy - args: ["--", "-D", "warnings"] - repo: local hooks: + - id: rustfmt + name: Check formatting + entry: cargo fmt -- + language: system + files: \.rs$ + - id: tests + name: Run tests + entry: cargo test + language: system + files: \.rs$ + pass_filenames: false + - id: clippy + name: Check clippy lints + entry: cargo clippy -- -D warnings + language: system + files: \.rs$ + pass_filenames: false - id: README name: Render README.md entry: docs/generate.sh