Skip to content

Commit

Permalink
Add pre-commit hook definition (#603)
Browse files Browse the repository at this point in the history
  • Loading branch information
mlegner authored Feb 9, 2024
1 parent 53d1292 commit 7544cfc
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .pre-commit-hooks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
- id: cargo-deny
name: check Cargo dependencies
description: check Cargo dependencies
entry: cargo-deny
language: rust
types: [file, toml]
files: Cargo\.(toml|lock)
pass_filenames: false
args: ["--all-features", "check"]
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,18 @@ cargo deny check sources

![sources output](docs/src/output/sources.svg)

### Pre-commit hook

You can use `cargo-deny` with [pre-commit](https://pre-commit.com). Add it to your local `.pre-commit-config.yaml` as follows:

```yaml
- repo: https://github.com/EmbarkStudios/cargo-deny
rev: 0.14.11 # choose your preferred tag
hooks:
- id: cargo-deny
- args: ["--all-features", "check"] # optionally modify the arguments for cargo-deny (default arguments shown here)
```
## Contributing
[![Contributor Covenant](https://img.shields.io/badge/contributor%20covenant-v1.4-ff69b4.svg)](CODE_OF_CONDUCT.md)
Expand Down

0 comments on commit 7544cfc

Please sign in to comment.