Skip to content

Commit

Permalink
feat: add pre-commit config (#20)
Browse files Browse the repository at this point in the history
Adds a pre-commit config.
  • Loading branch information
tdejager authored Sep 28, 2023
1 parent 95f7f2b commit 4fd4511
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
# Copied from Mozilla https://github.com/mozilla/grcov/blob/master/.pre-commit-config.yaml
- repo: https://github.com/DevinR528/cargo-sort
rev: v1.0.9
hooks:
- id: cargo-sort
- repo: local
hooks:
- id: fmt
name: fmt
language: system
types: [file, rust]
entry: cargo fmt
pass_filenames: false

- id: clippy
name: clippy
language: system
types: [file, rust]
entry: cargo clippy --all -- -D warnings # Use -D warnings option to ensure the job fails when encountering warnings
pass_filenames: false

- id: test
name: test
language: system
stages: [push]
types: [file, rust]
entry: cargo test
pass_filenames: false
- repo: https://github.com/codespell-project/codespell
rev: v2.2.5
hooks:
- id: codespell

0 comments on commit 4fd4511

Please sign in to comment.