Skip to content

Commit

Permalink
chore(git): add git hooks
Browse files Browse the repository at this point in the history
Signed-off-by: Anton Engelhardt <[email protected]>
  • Loading branch information
antonengelhardt committed Aug 5, 2024
1 parent f33087f commit 4254014
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 4 deletions.
23 changes: 22 additions & 1 deletion .pre-commit-config.yaml
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
repos:
- repo: https://github.com/gitleaks/gitleaks
rev: v8.16.1
rev: v8.18.2
hooks:
- id: gitleaks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: check-byte-order-marker
- id: check-case-conflict
- id: check-merge-conflict
- id: check-symlinks
- id: check-yaml
- id: end-of-file-fixer
- id: mixed-line-ending
- id: trailing-whitespace
- repo: https://github.com/pre-commit/pre-commit
rev: v3.7.1
hooks:
- id: validate_manifest
- repo: https://github.com/antonengelhardt/wasm-oidc-plugin
rev: v0.4.6
hooks:
- id: fmt
- id: clippy
- id: cargo-check
22 changes: 22 additions & 0 deletions .pre-commit-hooks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
- id: fmt
name: fmt
description: Format files with cargo fmt.
entry: cargo fmt
language: system
types: [rust]
args: ["--"]
- id: cargo-check
name: cargo check
description: Check the package for errors.
entry: cargo check
language: system
types: [rust]
pass_filenames: false
- id: clippy
name: clippy
description: Lint rust sources
entry: cargo clippy
language: system
args: ["--", "-D", "warnings"]
types: [rust]
pass_filenames: false
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ log = "0.4.22"
# proxy-wasm
proxy-wasm = "0.2.2"

# json, yaml, url parsing
url = { version = "2.5.2", features = ["serde"] }
serde = { version = "1.0.204", features = ["derive"] }
# parsing
url = { version = "2.5.0", features = ["serde"] }
serde = { version = "1.0.202", features = ["derive"] }
serde_yaml = "0.9.33"
serde_json = "1.0.120"
serde_urlencoded = "0.7.1"
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,8 @@ If you want to install a pre-commit hook - you should - install [pre-commit](htt
pre-commit install
```

The pre-commit hook will also check for a clean code style, formatting best practices and enforce clippy lints.

### Cargo-Deny

Cargo-deny checks all dependencies for security vulnerabilities and license issues.
Expand Down

0 comments on commit 4254014

Please sign in to comment.