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)
This commit is contained in:
Nick Groenen 2022-01-16 17:06:52 +01:00
parent d25c6d80c6
commit 081eb6c9ab
No known key found for this signature in database
GPG Key ID: 4F0AD019928AE098

View File

@ -5,15 +5,25 @@ repos:
rev: 9136088a246768144165fcc3ecc3d31bb686920a # frozen: v3.3.0 rev: 9136088a246768144165fcc3ecc3d31bb686920a # frozen: v3.3.0
hooks: hooks:
- id: check-yaml - 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 - repo: local
hooks: 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 - id: README
name: Render README.md name: Render README.md
entry: docs/generate.sh entry: docs/generate.sh