forked from openebs/mayastor-dependencies
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-config.yaml
32 lines (32 loc) · 1.11 KB
/
.pre-commit-config.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
repos:
- repo: https://github.com/nix-community/nixpkgs-fmt
rev: v1.2.0
hooks:
- id: nixpkgs-fmt
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
hooks:
- id: trailing-whitespace
- repo: local
hooks:
- id: rust-lint
name: Rust lint
description: Run cargo clippy on files included in the commit. clippy should be installed before-hand.
entry: nix-shell --pure --run ./scripts/rust/linter.sh
pass_filenames: false
types: [file, rust]
language: system
- id: rust-style
name: Rust style
description: Run cargo fmt on files included in the commit. rustfmt should be installed before-hand.
entry: nix-shell --pure --run ./scripts/rust/style.sh
pass_filenames: false
types: [file, rust]
language: system
- id: commit-lint
name: Commit Lint
description: Runs commitlint against the commit message.
language: system
entry: bash -c 'nix-shell --pure --run "cat $1 | grep -v '^#' | commitlint"'
args: [$1]
stages: [commit-msg]