forked from pyth-network/per
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.pre-commit-config.yaml
70 lines (70 loc) · 2.32 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
exclude: "^sdk/rust/abi/.*"
- id: check-added-large-files
exclude: package-lock.json
# Hook to format many type of files in the repo
# including solidity contracts.
- repo: https://github.com/pre-commit/mirrors-prettier
rev: "v2.7.1"
hooks:
- id: prettier
additional_dependencies:
exclude: "^sdk/rust/abi/.*"
- repo: local
hooks:
# Hooks for workspace
- id: cargo-fmt-workspace
name: Cargo format for workspace
language: "rust"
entry: cargo +nightly-2024-12-03 fmt --manifest-path ./Cargo.toml --all -- --config-path rustfmt.toml
pass_filenames: false
files: .
- id: cargo-clippy-workspace
name: Cargo clippy for workspace
language: "rust"
entry: cargo +stable clippy --manifest-path ./Cargo.toml --tests -- -D warnings
pass_filenames: false
files: .
# Hooks for contracts-svm
- id: cargo-fmt-contracts-svm
name: Cargo format for svm contracts
language: "rust"
entry: cargo +nightly-2024-12-03 fmt --manifest-path ./contracts/svm/Cargo.toml --all -- --config-path rustfmt.toml
pass_filenames: false
files: contracts/svm
- id: cargo-clippy-contracts-svm
name: Cargo clippy for svm contracts
language: "rust"
entry: cargo +stable clippy --manifest-path ./contracts/svm/Cargo.toml --tests -- -D warnings
pass_filenames: false
files: contracts/svm
# EsLint hooks
- id: eslint
name: eslint
entry: pnpm -r lint
pass_filenames: false
language: system
files: .
# For python files
- id: isort
name: isort
entry: poetry -C per_sdk run isort --profile=black per_sdk
pass_filenames: false
language: system
- id: black
name: black
entry: poetry -C per_sdk run black per_sdk
pass_filenames: false
language: system
- id: pyflakes
name: pyflakes
entry: poetry -C per_sdk run pyflakes per_sdk
pass_filenames: false
language: system