forked from openebs/mayastor-control-plane
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-config.yaml
48 lines (48 loc) · 1.66 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
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
exclude: openapi/
- repo: local
hooks:
- id: openapi-check
name: OpenApi Code Generator
description: Ensures OpenApi bindings are up to date
entry: ./scripts/rust/generate-openapi-bindings.sh
args: ["--spec-changes"]
pass_filenames: false
language: system
- 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 'cargo-clippy --all --all-targets -- -D warnings'
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 'cargo-fmt --all -- --check'
exclude: openapi/
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]
- id: python-check
name: python lint
entry: black
description: runs black against the python code
pass_filenames: true
types: [file, python]
language: system